Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-24-2015, 05:01 AM   #1
LQ Newbie
Registered: Nov 2015
Posts: 2

Rep: Reputation: Disabled
Separate network traffic on NICs


I'm working on a network device with 2 NICS:
  • eth0 for monitor & control (http, snmp, ssh, etc) with dhcp or static ip
  • eth1 for data traffic, with static ip
With the regular configuration, eth0 and eth1 are in separated physical networks. But the user is free to configure his network, so it should also work with both interfaces in the same network/subnet. For testing purposes I used this configuration:
eth0 netmask
eth1 netmask
As long as both network interfaces are connected, this configuration works fine. But when disconnecting one interface I noticed:
  • I can ping both IP addresses even if the secondly configured NIC is disconnected
  • Both IPs are not reachable when the firstly configured NIC is disconnected
My interpretation: When both NICs match, the (ping) response is sent via the first matching. If this is not connected - the response cannot be sent.

I ve followed a description, how to separate network interfaces - but without success:
echo "1 admin10" >> /etc/iproute2/rt_table
echo "2 admin11" >> /etc/iproute2/rt_table

ip route del default

route add default gw dev eth1
route add default gw dev eth0

ip route add 0/0 dev eth0 table admin10
ip rule add from table admin10
ip rule add to table admin10

ip route add 0/0 dev eth1 table admin11
ip rule add from table admin11
ip rule add to table admin11
The idea is, to force all traffic with source=eth0 to be sent via eth0 - and source=eth1 via eth1.

Last edited by blueSpirit25; 11-24-2015 at 07:36 AM. Reason: [SOLVED]
Old 11-24-2015, 07:35 AM   #2
LQ Newbie
Registered: Nov 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Update: it's working like written.

It seems that there are some other problem: From time to time I have to unplug and plug-in the cable to get the network working...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Forwarding DNS between two nics (separate networks) dave247 Linux - Networking 6 10-02-2011 01:09 PM
Run 2 NICs, separate networks liche24 Fedora 1 03-14-2009 11:20 PM
Two NICs network traffic goes only through one gemini728 Linux - Networking 6 07-08-2007 10:48 AM
Linux setup as router / DHCP w/3+ NICs, separate but shared connectivity - question MetaTechi3 Linux - Networking 3 11-17-2006 11:41 AM
Separate NICs to raise the bandwith ivanatora Linux - Networking 2 07-26-2004 03:52 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration