Linux configuration Dual-Nic dual-route

Source: Internet
Author: User

CentOS双网卡双IP设置   系统环境:CentOS Linux network environment:  two IP addresses, 10.4.34.31 and 10.4.35.31, the Mask is 255.255.255.0, 这两个子网的网关地址分别是10.4.34.1和10.4.35.1。   1.  Configure the IP address 10.4.34.31 for the NIC eth0, configure the IP address for the NIC Eth1 to the 10.4.35.31 profile: /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1   2. 配置默认网关为任意一个。这个默认网关,决定了系统主动去使用网络时,使用的接口。 配置文件: /etc/sysconfig/network   3. 编辑路由表 a、修改 /etc/iproute2/rt_tables ,添加内容: 252  net2 251  net3 b、修改 /etc/rc . local ,添加原路返回路由: ip route flush table net2 ip route add default via 10.4.34.1 dev eth0 src 10.4.34.31  Table net2 ip rule add from 10.4.34.31 table net2 ip route flush table net3 ip route add default via 10.4.35.1 dev eth1 src 10.4.35.31  Table net3 ip rule add from 10.4.35.31 table net3 参考:http: //www .lartc.org /LARTC-zh_CN .GB2312.pdf

This article is from the "Target: India" blog, please be sure to keep this source http://shunzi115.blog.51cto.com/5184443/1825956

Linux configuration Dual-Nic dual-route

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.