位置:海鸟网 > IT > linux/Unix >

Linux常用技巧:教你同一块网卡配置多个IP

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
   DEVICE=eth0

   BOOTPROTO=static

   BROADCAST=192.168.99.255

   IPADDR=192.168.1.155

   NETMASK=255.255.252.0

   NETWORK=192.168.1.0

   ONBOOT=yes

   $ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1

   DEVICE=eth0:1

   BOOTPROTO=static

   BROADCAST=192.168.99.255

   IPADDR=192.168.1.182

   NETMASK=255.255.252.0

   NETWORK=192.168.1.0

   ONBOOT=yes