Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Dual WAN and routing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Dr.Drake
n00b
n00b


Joined: 13 Jun 2013
Posts: 2

PostPosted: Thu Jun 13, 2013 5:52 am    Post subject: [Solved] Dual WAN and routing Reply with quote

Greetings!
I've been struggling with my routing for couple of days and I haven't been able to find a solution on my own... so I thought maybe someone here could give me a hand.

I have two internet connections, one is low latency and low bandwidth (WAN1) and another is high latency and high bandwidth (WAN2). And then there is LAN too. I have basics set up, and everything gets routed from LAN via WAN1 smooth and nicely. I wish I could route all traffic that goes through Squid proxy through the high bandwidth route, but I haven't really been able to get this work. I've set tcp_outgoing_address in squid to 192.168.2.2 and netstat says it really is the origin of the proxys outgoing traffic. However it gets routed through the WAN1 also. I've tried to create route from 192.16.8.2.2 via 192.16.8.2.1 gateway by using
Code:
ip route add 192.168.2.1 dev eth1 src 192.168.2.2

Obviously this doesn't work :oops:

My network structure is like this:

WAN1 <-- eth0 ---> Router <-- eth1 ---> WAN2

WAN1 (eth0) - the default route:
IP: 10.2.3.7
NM: 255.255.255.0
GW: 10.2.3.1

WAN2 (eth1) - the route I would like to squid use.
IP: 192.168.2.2
NM: 255.255.255.0
(GW: 192.168.2.1)

LAN (eth2):
IP: 192.168.0.1
NM: 255.255.255.0

My Kernel IP routing table looks like this by default when I fire up the router:
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.2.3.1        0.0.0.0         UG    100    0        0 eth0
10.2.3.0        *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth2
192.168.2.0     *               255.255.255.0   U     0      0        0 eth1


iptables script I have, that allows traffic from LAN to WAN1:
Code:
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth2 -j ACCEPT


Last edited by Dr.Drake on Tue Jun 25, 2013 11:40 am; edited 1 time in total
Back to top
View user's profile Send private message
papahuhn
Guru
Guru


Joined: 06 Sep 2004
Posts: 581

PostPosted: Thu Jun 13, 2013 7:12 am    Post subject: Reply with quote

Have a look here http://lartc.org/howto/lartc.rpdb.multiple-links.html
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
Dr.Drake
n00b
n00b


Joined: 13 Jun 2013
Posts: 2

PostPosted: Tue Jun 25, 2013 11:39 am    Post subject: Reply with quote

It's been a while but thanks. I got it working with assistance of the page you provided.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum