標籤:style blog color os 檔案 div log line sp
Ubuntu配置雙IP
sudo vim /etc/network/interfaces 開啟IP設定檔
1 auto lo 2 iface lo inet loopback 3 auto eth0 4 iface eth0 inet static 5 #pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx 6 address 210.47.248.180 7 netmask 255.255.255.0 8 gateway 210.47.248.254 9 nameserver 8.8.8.810 auto eth0:011 iface eth0:0 inet static12 address 192.168.3.4013 netmask 255.255.255.0
pre-up ifconfig eth0 hw ether 為複製mac地址
auto eth0:0 為增加的IP
Centos 6.5 配置雙IP
sudo vim /etc/sysconfig/network-scripts/ifcfg-Auto_eth0
1 HWADDR=74:D0:2B:27:30:FF 2 TYPE=Ethernet 3 BOOTPROTO=none 4 IPADDR=210.47.248.171 5 PREFIX=24 6 GATEWAY=210.47.248.254 7 DNS1=8.8.8.8 8 DEFROUTE=yes 9 IPV4_FAILURE_FATAL=yes10 IPV6INIT=no11 NAME="Auto eth0"12 UUID=3baad9b7-be6c-419b-bfff-c19a3ff1fe6013 ONBOOT=yes14 LAST_CONNECT=140567100515 IPADDR2=192.168.3.416 PREFIX2=24
IPADDR2與PREFIX2為增加ip項,PREFIX值為24等同於子網路遮罩為255.255.255.0
Ubuntu 與CentOS 6.5 配置單網卡雙IP