Multiple IP addresses for multiple NICs in the same network segment in Linux

Source: Internet
Author: User

Two NICs may be disconnected in the same network segment, but the IP addresses that ping the NIC can still be pinged. The two IP addresses are directed to the same MAC address.


Eth0 192.168.1.10
Eth1 192.168.1.11

Echo "252 net2">/etc/iproute2/rt_tables
Echo "251 net3">/etc/iproute2/rt_tables

IP Route add 192.168.1.0/24 Dev eth0 SRC 192.168.1.10 table net2
IP Route add 192.168.1.0/24 Dev eth1 SRC 192.168.1.253 table net3
IP Route add default Dev eth0 table net2
IP Route add default Dev eth1 table net3

IP rule add from 192.168.1.10 table net2
IP rule add from 192.168.1.11 table net3

IP Route flush Cache

 

Ping, and then ARP verifies that the MAC address is different.

ARP-

 

 

 

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.