[LARTC] [reformat]please, check out this configuration(load shareing)

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My Testing Network:

+---------------------------+     +-------------+
|              Internet                   |---| z.z.z.z         |
+---------------------------+     +-------------+
     |                         |
     |                         |  
     | ppp0 x.x.x.x      |ppp0 y.y.y.y
+-----------+           +-------------+
|   Server1    |eth1     |Server2         |
|                  |-------|                    |
+-----------+     eth1+----------- -+
         |
         |  eth2 172.31.0.254/16

Server1 eth1:  172.30.0.1/16, Server2:  172.30.0.2/16


Server1's ip rule show
0:             from all     lookup local
32765:      from 172.31.0.0/16  to  z.z.z.z   lookup 10
.....                    lookup main
....                     lookup 253

Server1's ip route show:
x.x.x.1           dev ppp0  proto kernel scope link src  x.x.x.x
172.30.0.0/16  dev eth1   proto kernel scope  link src  172.30.0.1
172.31.0.0/16  dev eth2   proto
................................172.31.0.254
127.0.0.0/8 .... lo
default
          nexthop  via 172.30.0.2   dev eth1  weight 1
          nexthop  dev    ppp0  weight 1

 ip route show table 10:
default   dev eth1    scope link

iptables rule:
 iptables   -t nat  -A POSTROUTING  -s 172.31.0.0/16 -d 0.0.0.0/0 \
 -o  ppp0   -j MASQUERADE
 iptables   -t nat  -A POSTROUTING  -s 172.31.0.0/16 -d 0.0.0.0/0 \
 -o  eth1   -j SNAT --to 172.30.0.1


Server2's ip rule show:
0:             from all     lookup local
.....                    lookup main
....                     lookup 253

Server2's ip route show:
y.y.y.1           dev ppp0  proto kernel scope link src  y.y.y.y
172.30.0.0/16  dev eth1   proto kernel scope  link src  172.30.0.1
127.0.0.0/8 .... lo
default
          nexthop  via y.y.y.1   dev ppp0

iptables rule:
 iptables   -t nat  -A POSTROUTING  -s 172.30.0.0/16 -d 0.0.0.0/0 \
 -o ppp0   -j MASQUERADE

My purposes are:
1:  load sharing with  ppp0 and eth1.
2.  when trying connect to z.z.z.z, It should use eth1.
( Now, for test, eth1 is private network but final purpose It will be
changed to public network.)

In this situation, the 172.31.0.0/16 network can't establish connection  to
z.z.z.z.
When I delete the rule (ip rule del from 172.31.0.0/16 to z.z.z.z lookup
10), The connection is established.

And the other question,
Why the source IP of the packet that going out from eth1 have ppp0's IP
address?
(In my result, It's really happened..

What's wrong in upper configuration?

thanks.





[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux