ITeye博客

centos 6.4 minimal 静态IP配置

5xnl · 2013-08-16 15:56 · linux · 操作系统 · CentOS · Linux · 网络配置 · Markdown

1、设置静态IP和DNS


vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"

BOOTPROTO="static"

HWADDR="00:0C:29:86:3D:16"

IPV6INIT="yes"

NM_CONTROLLED="yes"

ONBOOT="yes"

TYPE="Ethernet"

UUID="dcf18d86-45ea-4b5c-9627-e75b19b3b6e7"

IPADDR=192.168.1.88

NETMAST=255.255.255.0

DNS1=61.139.2.69

2、网关设置


在文件 vi /etc/sysconfig/network最后一行加入:

GATEWAY=192.168.1.1

** 3.网络命令**

ifdown eth0 //关闭网络
ifconfig eth0 down //关闭网络
ifup eth0 //开启网络
ifconfig eth0 up //开启网络
service network start //启动网络服务
service network stop //停止网络服务
service network restart //重启网络服务
service network status //查看网络服务状态
ifconfig -a //查看所有网卡的参数
 

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。