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

Notices

Reply
 
Search this Thread
Old 03-31-2010, 05:52 PM   #1
wazh
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 172.16.2.251 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.

Thanks
 
Old 04-03-2010, 09:25 AM   #2
devwatchdog
Member
 
Registered: Jan 2010
Posts: 198

Rep: Reputation: 44
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.

****EDIT:

Found it:

http://www.linuxquestions.org/questi...-links-787973/

That problem looks similar to yours.

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

Original Poster
Rep: Reputation: 0
Hi,

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, 05:37 AM   #4
wazh
LQ Newbie
 
Registered: Feb 2007
Posts: 6

Original Poster
Rep: Reputation: 0
OK,

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 192.168.0.254 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 192.168.0.101

I added to rt_tables 200 squid.

I did two entries

ip rule add from 172.16.2.0/24 table squid
ip route add default via 192.168.0.254 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 07:18 PM.
 
  


Reply


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


All times are GMT -5. The time now is 01:57 PM.

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