Alessandro Topo Galileo writes:
> Hello all. I have a routing problem.
> I have a linux machine (OpenSuSE) that acts as a gateway for the LAN
> and is connected to internet using two different internet providers.
> I want to ping this linux machine from the lan and from outside, using
> both public ip (even from the lan, I have to call linux using external
> public ip and not the internal lan ip).
> Let's call:
> $IP1 = linux ip on first provider's net
> $P1_NET = first provider's net
> $P1 = default gateway ip on first provider's net
> $IF1 = ethernet interface wired with first provider's net
> I have tried these commands:
> ip route add $P1_NET dev $IF1 src $IP1 table 1
> ip route add default via $P1 table 1
> ip route add $P2_NET dev $IF2 src $IP2 table 2
> ip route add default via $P2 table 2
> ip route del default
> ip route add default via $P1
> ip rule add from $IP1 table 1
> ip rule add from $IP2 table 2
If you try to ping $IP1 from LAN, the replies you get on your LAN box
will be from $IP1. But since you specified a rule for all packets from
$IP1, the table 1 is considered which doesn't contain any routing rule
for your LAN

.
> Now, if I ping $IP1 or ping $IP2 I get correct answer from outside but
> not from the LAN.
> If I substitute the 7th line with this line:
> ip rule add from $IP1 to 82.0.0.0/8 lookup 2
So adding above rule, restricts the rule to packets going to
82.0.0.0/8

.
HTH
--
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
iEYEARECAAYFAkiF6Z0ACgkQHy+EEHYuXnTmSQCgt2hAlcHhyM r9HBE2eSWmmRgI
JWgAoO3jdGEcuCXOz07ylG4oSSvmEfjM
=oCGf
-----END PGP SIGNATURE-----