Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-31-2010, 06:52 PM   #1
LQ Newbie
Registered: Feb 2007
Posts: 6

Rep: Reputation: 0
Redirect Squid to another gateway

Hi All,

I have recently just got another internet connection at home via cable as well as my exisiting DSL connection. I was wanting all my web browsing that I did via squid to be redirected down the cable connection. The box has a single nic at the moment and the default route sends it via the dsl connection for the mail server that is also running on the box.

I was hoping that anything that hit squid would go down the cable connection that is plugged into a router and thus I can route to and everything will go out via cable.

I was reading about iproute2 and marking the packets and is wondering whether this is the way to go?

Some input would really help.

Old 04-03-2010, 10:25 AM   #2
Registered: Jan 2010
Posts: 202

Rep: Reputation: 47
Are you intending to add another NIC for the cable connection, or are you going to utilize the existing NIC for this traffic? It is possible to use the same NIC for both I imagine, although I have to admit I've never tried it. Are you going to use a switch or something to connect your DSL and cable connections to your system?

What I am thinking is defining a virtual interface on the existing NIC, and then sending the traffic to the cable modem via that interface.

I recall working with someone on something similar not long ago here. In that situation, the system was using two interfaces to connect to the corresponding WAN connections, but the concept would be the same. They were using a squid server and wanted to send traffic via a secondary WAN interface.

I'll see if I can track down that tread.


Found it:

That problem looks similar to yours.

Last edited by devwatchdog; 04-03-2010 at 10:32 AM.
Old 04-03-2010, 07:30 PM   #3
LQ Newbie
Registered: Feb 2007
Posts: 6

Original Poster
Rep: Reputation: 0

Thanks so much for the response. That thread did help a great deal. However a couple of things. At this stage I dont have a second nic in the box and was hoping to use the exisiting nic and not have to worry about second nics and just send the packets to another gateway. If this is more trouble than its worth then certainly I will add the second nic. At the moment I have a router plugged into the cable modem which goes to a switch that the dsl is plugged into. The dsl has a gateway and the cable has a gateway. Depending on which route I wish to take I choose those gateways. Highly inflexible.

Any help would be greatly appreciated
Old 04-04-2010, 06:37 AM   #4
LQ Newbie
Registered: Feb 2007
Posts: 6

Original Poster
Rep: Reputation: 0

So I bit the bullet and put the second nic in today as I was having no joy on making it work out the primary interface.

So the cable network is on 192.168.0.x and is plugged via the router into the second nic.. which oddly came up as eth2 but what the hell.

The primary network is on 172.16.2.x

I added tcp_outgoing_address which is the default gateway that the router gave to eth2 via dhcp. (edit) this appears to be my error and should be the ip of the interface. Will change this to be

I added to rt_tables 200 squid.

I did two entries

ip rule add from table squid
ip route add default via table squid

of course when I add the second entry I loose all connectivity. Which means I have a problem.

Anyone got any answers?

Thanks so much

Last edited by wazh; 04-05-2010 at 08:18 PM.


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
normal default gateway reapperas with openvpn redirect-gateway jonnytabpni Linux - Networking 2 04-23-2009 03:11 PM
How to redirect http port 80 from slackware gateway to redhat proxy cmarasescu Linux - Networking 1 06-16-2006 10:26 PM
Squid redirect butchybro Linux - Networking 0 06-04-2005 06:06 AM
Another squid redirect problems wylie1001 Linux - Software 2 10-02-2004 01:29 AM
How do I get iptables to redirect my default gateway address? Paul Woodhouse Linux - Networking 3 11-11-2003 09:52 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:22 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