Share your knowledge at the LQ Wiki.
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 10-15-2009, 03:53 PM   #1
LQ Newbie
Registered: Dec 2004
Distribution: Ubuntu
Posts: 18

Rep: Reputation: 0
Question Multiple NIC on Ubuntu Box - Isolating traffic to specific interfaces

Hello Community,
I have two custom built ubuntu boxes running 9.04 Server edition on them. Both these boxes have two gigabit NIC cards. They are connected to a 24 port layer 2 switch which is connected to my wireless router.

Router (
24 port Gigabit switch
| |
| |-- Ubuntu 9.04 Server ( 100 Mbps NIC
| |-- Ubuntu 9.04 Server ( 1 Gbps NIC
|-- Ubuntu 9.04 Server ( 100 Mbps NIC
|-- Ubuntu 9.04 Server ( 1 Gbps NIC

The network card configuration files have the default gw set to for both the NICs in the two machines.
My objective is to have certain services listen to specific address only while the general traffic (SSH, apt-get etc) use the other interface. The problem I am facing is that I am able to get into the box from outside. My SSH, DNS, MySQL and Tomcat servers are visible from other machines on my network but I am not able to see the internet from within these boxes. For instance, I can SSH into or but I cannot ping from within these boxes.
However, If I do route add default gw the problem goes away but then I am not able to divert the internal traffic to a specific card.
The idea here is to use the gigabit cards for my services (SMB/ DB) and the 100Mbps cards for running update check or browing the internet etc.
What should I change in my iptables to get what I want?
Old 10-16-2009, 09:03 AM   #2
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
Hi whitehawk,

You shouldn't need to get iptables involved.
This should be possible with proper routing.

Please post the output from a 'netstat -rn' and 'ifconfig -a'.

Are you using network config files for individual cards?
If so, please post the content of these files.



dedicated, ip, multiple, networking, nic, ubuntu

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
Multiple interfaces - All traffic flows through just one... crazyivan Linux - Networking 16 03-05-2012 05:02 AM
how to redirect squid traffic to a specific nic card scream Linux - Newbie 0 03-08-2009 03:57 AM
NFS - How can I direct traffic to a specific nic? gislil Linux - Networking 2 10-25-2006 04:59 AM
Multiple Interfaces + Cisco 515 and default NIC streamalot Linux - Networking 0 06-12-2006 01:43 PM
Need to route traffic through specific nic cards... Thaidog Linux - Networking 4 07-01-2005 07:31 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:06 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration