Redhat设置固定ip:


# vi /etc/sysconfig/network-scripts/ifcfg-eth0


BOOTPROTO=static

IPADDR=172.16.0.5

NETMASK=255.255.255.0

GATEWAY=172.16.0.1


:wq


# service network restart


Debian设置固定ip:


# vi /etc/network/interface


iface eth0 inet static

address 172.16.0.6

netmask 255.255.255.0

gateway 172.16.0.1


:wq


需重启服务器生效