From: Javier Suarez <listas@slater-i.com>
To: lartc@vger.kernel.org
Subject: [LARTC] IP route balance problem
Date: Tue, 28 Mar 2006 11:23:59 +0000 [thread overview]
Message-ID: <44291CCF.40007@slater-i.com> (raw)
Hello
Im having a problem similar to sawar
Here is my configuration
--------------eth1---192.168.1.128---------- -------------192.168.1.1 ISP router 1
| my |
---Eth0---192.168.10.157----| |
| linux |
|
------------eth2---192.168.254.128----- ----------------192.168.254.254 ISP router 2
What I want to do is a balance charging and itsnt working
The Kernel version es 2.6.14
root@enrutizador:~# uname -a
Linux enrutizador 2.6.12-9-386 #1 Mon Oct 10 13:14:36 BST 2005 i686
GNU/Linux
Eth1 and Eth2 are well coneccted to Routers...
root@enrutizador:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl\x128 time=0.726 ms
root@enrutizador:~# ping 192.168.254.254
PING 192.168.254.254 (192.168.254.254) 56(84) bytes of data.
64 bytes from 192.168.254.254: icmp_seq=1 ttl%5 time=0.802 ms
And here is the script I use to do it work...
#!/bin/sh
P1_NET\x192.168.1.0/24
IF1=eth1
IP1\x192.168.1.128
P1\x192.168.1.1
P2_NET\x192.168.254.0/24
IF2=eth2
IP2\x192.168.254.128
P2\x192.168.254.254
ip addr add $IP1/24 brd + dev $IF1
ip addr add $IP2/24 brd + dev $IF2
ip link set $IF1 up
ip link set $IF2 up
ip route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2
ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2
ip route add equalize default nexthop via 192.168.254.254 dev eth2
nexthop via 192.168.1.1 dev eth1
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2
I have read in books and faqs and this should enough to do balance
charging working, but isn't.
The problem is the same than sawar, src ips are wrong...or at least
stranges :-/
The configuration from the boot is as follow
Clear system after boot
root@enrutizador:~# ip route ls
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.157
After execute the configuration script
root@enrutizador:~# ip route ls
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.128
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.157
192.168.254.0/24 dev eth2 proto kernel scope link src 192.168.254.128
default equalize
nexthop via 192.168.254.254 dev eth2 weight 1
nexthop via 192.168.1.1 dev eth1 weight 1
The problem like sawar...
root@enrutizador:~# for x in $(seq 1 10); do ip r g 130.206.1.$x; done
130.206.1.1 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.2 via 192.168.1.1 dev eth1 src 192.168.254.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.3 via 192.168.1.1 dev eth1 src 192.168.254.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.4 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.5 via 192.168.1.1 dev eth1 src 192.168.254.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.6 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.7 via 192.168.1.1 dev eth1 src 192.168.254.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.8 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.9 via 192.168.1.1 dev eth1 src 192.168.254.128
cache mtu 1500 advmss 1460 hoplimit 64
130.206.1.10 via 192.168.1.1 dev eth1 src 192.168.1.128
cache mtu 1500 advmss 1460 hoplimit 64
The only ips that repond to the Pings are the ones where via and src
are in the same net
I have tryed too the solution you gave to sawar and activate the nat
root@enrutizador:/proc/sys/net/ipv4# modprobe iptable_nat
root@enrutizador:/proc/sys/net/ipv4# iptables -t nat -A POSTROUTING -s
192.168.254.128 -o eth1 -j SNAT --to-source 192.168.1.128
root@enrutizador:/proc/sys/net/ipv4# iptables -t nat -A POSTROUTING -s
192.168.1.128 -o eth2 -j SNAT --to-source 192.168.254.128
But itsn't working yet
root@enrutizador:~# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 192.168.254.128 anywhere
to:192.168.1.128
SNAT all -- 192.168.1.128 anywhere
to:192.168.254.128
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
What Im doing bad please? or what is wrong?
A lot of thanks for at least try to undesrtand the mail :-)
Javier Suarez
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
next reply other threads:[~2006-03-28 11:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-28 11:23 Javier Suarez [this message]
2006-03-28 14:31 ` [LARTC] IP route balance problem William L. Thomson Jr.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44291CCF.40007@slater-i.com \
--to=listas@slater-i.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.