Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 24th July 2007, 21:59
sjau sjau is offline
Local Meanie
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts
Default Routing applications to certain network cards


I think I have a difficult question:

I have two network cards (1 wifi & 1 ethernet). At home I can connect with the wifi card to my uni-network or I can use my normal internet access by ethernet/wifi.

Now, the uni-network is limited but very quick. The normal inet access is not limited but, compared to the uni-network, slow.

How could I make now that certain programs use exclusively only one of the network cards? E.g. browser, email, ... only use the wifi-card connected to the uni network
And stuff like irc (is blocked at university) only use my normal ethernet card with my normal inet access?

Currently I'm using Ubuntu Feisty.
Reply With Quote
Sponsored Links
Old 25th July 2007, 17:34
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts

Hm, good question. Maybe this can be done with iptables?
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Old 26th July 2007, 08:06
sjau sjau is offline
Local Meanie
Join Date: Apr 2006
Location: Switzerland
Posts: 1,158
Thanks: 4
Thanked 58 Times in 54 Posts

well, I think it can be done with iptables since the applications use specific ports but I haven't ever played around with iptables.

Another thing I stumbled accross is "socks" but I'm not sure if I get the concept of what that is.
Reply With Quote
Old 7th August 2007, 11:08
geekman geekman is offline
Join Date: Sep 2006
Location: Sydney, Australia
Posts: 56
Thanks: 1
Thanked 10 Times in 10 Posts
Send a message via ICQ to geekman Send a message via MSN to geekman

I think you might be able to do something like this?

Make website traffic go through eth1
iptables --insert OUTPUT 1 --dport 80 --jump ACCEPT --out-interface 'eth1'

Make Bit Torrent go through eth0

iptables --insert OUTPUT 1 --dport 6881 --jump ACCEPT --out-interface 'eth0'

Though this is totally untested and iptables may not even like that syntax of using dport...not sure. I just based it off some routing I already to with IPTables where I say: if traffic is coming from here and going to there use this interface.
if traffic is coming from somewhere else and going here then use this interface instead.

Just a note, you'd want basically the same rules but for the source port also so both incoming and outgoing traffic goes through the right Interface. A further edit you'd need to use --in-interface instead for these rules...just a guess, and there might be a more efficient way of doing it too i.e. only needing one rule per port.


Last edited by geekman; 7th August 2007 at 11:12.
Reply With Quote


Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Identical network cards in ipcops Imran Installation/Configuration 7 23rd August 2009 02:10
Slow network performance reading data JoeySpace Installation/Configuration 2 10th April 2007 18:42
routing configuration dimas Installation/Configuration 2 4th August 2006 23:32
Perfect Xen 3.0 setup for Debian gurneyzap HOWTO-Related Questions 4 26th March 2006 12:30
Network Cards and access mphayesuk Installation/Configuration 3 5th March 2006 11:33

All times are GMT +2. The time now is 22:27.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.