Ubuntu 與CentOS 6.5 配置單網卡雙IP

來源:互聯網
上載者:User

標籤: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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.