Hi all!
Here is my network
linux1:
eth0=192.168.1.1
ppp0=192.168.5.2
gw=192.168.1.2 ( thru ADSL)
compA=192.168.1.6
compB=192.168.1.15
.........................user1,user2
comp A---------|----------------|................................|
......................| linux1----------|------------adsl--------|
comp B---------|----------------|...............................|internet
.............................|......................|--------|
............................. \------ppp0-----|linux2 |---------|
.....................................................|--------|............|
Better network diagram is here:
http://desima.objectis.net/network-diag/
Question: how to allow compB and user2 to use ppp0?
if I change default route to ppp0 then it is posiible to set compA use adsl and compB to use ppp0, if I change default route back to eth0(192.168.1.2) then it is not possible for compB( or user2) use ppp0 for getting acces to internet
got error MASQUERADE: Route sent us somewhere else.
If I route thru other comp on 192.168.1.217 ( which has ppp to internet)
ip route change default via 192.168.1.217 table T2
everithing works!
config:
ip rule ls:
0: from all lookup local
32750: from all fwmark 0x1 lookup T2
32751: from 192.168.5.2 lookup T2
32752: from 192.168.5.1 lookup T2
32756: from 192.168.1.6 lookup T1
32757: from 192.168.1.15 lookup T2
32766: from all lookup main
32767: from all lookup default
ip route table T2
192.168.5.0 dev ppp0 scope link src 192.168.5.2
192.168.1.0/24 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.5.1 dev ppp0
ip route ls
192.168.1.0 dev eth0 scope link src 192.168.1.1
192.168.5.1 dev ppp0 proto kernel scope link src 192.168.5.2
203.97.61.42 via 192.168.1.2 dev eth0
192.168.1.0/24 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 192.168.1.2 dev eth0
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
What I am doing wrong?