routing philosophy
Hi,
Some notes on routing philosophy with linux.
Suposse you have an IP on eth0, say A.B.C.D, and a default gateway A.B.C.E using:
ip ad ad A.B.C.D/24 dev eth0
ip rou ad default via A.B.C.E
All is OK and working.
Suposse now you define a routing table Test and do:
ip rou ad default via A.B.C.E table Test
ip rule add from A.B.C.D table Test
ip rou flu cac
All is still OK, then you put an INVALID default gateway A.B.C.Y (this IP is not a gateway, in fact it is no associated to any computer):
ip rou del default
ip rou ad default via A.B.C.Y
Then, you telnet some_IP, IT WORKS as pakets are routed USING table Test. If you do:
ip rou get some_IP
it says:some_IP via A.B.C.Y dev eth0 src A.B.C.D
Is this a correct response????
If you issue:
ip rou get some_IP from A.B.C.D
it says the coreect answer:some_IP from A.B.C.D via A.B.C.E dev eth0
In fact if you do:
ip rou del default
then
telnet some_IP
it says:
Trying some_IP...
telnet: connect to address some_IP: Network is unreachable
but this is not true ... as default gw of main table is never used.
So it seems you have to stat some (even invalid) default gateway to achieve routing. Any comment??
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
Quoted 6 lines
ip rou get
some_IPit says:
some_IPvia A.B.C.Y dev eth0 src A.B.C.DIs this a correct response????
I think is Ok because is using lo interface
Quoted 4 lines
it says:
Tryingsome_IP...
telnet: connect to addresssome_IP: Network is unreachable
Number associated to table Test is minor than asociated to table main ?
Do you try to add ip ru add from 127.0.0.1 table Test ?
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/