1. 程式人生 > >Ubuntu 14.04用配置檔案配置靜態IP和動態IP

Ubuntu 14.04用配置檔案配置靜態IP和動態IP

1,靜態IP:

# cat  /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)                                                                         
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 219.224.167.193
gateway 219.224.167.129
netmask 255.255.255.0
broadcast 219.224.167.255

=============================

2,動態IP:

# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp