先看看Redhat下的静态IP地址设置
[root@linux-a ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 网卡IP配置文件
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.231
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
再看看Ubuntu下的静态IP地址设置
frankliu@ubuntu-sa:~$ vi /etc/network/interfaces 配置文件地址与Redhat不同
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.80
netmask 255.255.255.0
gateway 192.168.0.2
龙生九子各有不同,都是linux系统但是网络设置还是有比较大的区别的,首先是配置文件不同,其次IP地址的参数也不同,另外Redhat参数是要大写的,而Ubuntu的参数是小写。
DNS的配置是一样的:
[root@linux-a ~]# cat /etc/resolv.conf
nameserver 192.168.0.2
另外CentOS是从Redhat衍生出来的,因此IP地址的配置格式和Redhat一样。