linux配置雙網卡雙路由

來源:互聯網
上載者:User

標籤:linux   ip   route   雙網卡   雙路由   多路由   

CentOS雙網卡雙IP設定 系統內容:CentOS Linux網路環境: 兩個IP地址,10.4.34.31和10.4.35.31,掩碼是255.255.255.0,這兩個子網的網關地址分別是10.4.34.1和10.4.35.1。 1. 為網卡eth0配置ip地址10.4.34.31,為網卡eth1配置ip地址為10.4.35.31設定檔為:/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network-scripts/ifcfg-eth1 2. 配置預設閘道為任意一個。這個預設閘道,決定了系統主動去使用網路時,使用的介面。設定檔:/etc/sysconfig/network 3. 編輯路由表a、修改/etc/iproute2/rt_tables,新增內容:252  net2251  net3b、修改/etc/rc.local,添加原路返迴路由:ip route flush table net2ip route add default via 10.4.34.1 dev eth0 src 10.4.34.31 table net2ip rule add from 10.4.34.31 table net2ip route flush table net3ip route add default via 10.4.35.1 dev eth1 src 10.4.35.31 table net3ip rule add from 10.4.35.31 table net3參考:http://www.lartc.org/LARTC-zh_CN.GB2312.pdf


linux配置雙網卡雙路由

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.