Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have a weird issue with source routing on a linux box.
The plan goes like this:
I have 2 internet providers at my office and i want to use a single router to route them both ( i don't need load balancing or failover). I just want access to either provider based on the ip i use on my pc.
The first provider, let's call it RDS, is simple: i've got an RDS_IP, RDS_MASK and RDS_GW.
The second provider is complicated, we'll call it INES. I have a INES_IP, INES_MASK, INES_GW and they also gave me a subnet of public ip's: ILAN_NET which i have to route myself through INES_IP.
I also have a third nic with an local ip: LAN_NET and an alias for the INES subnet: ILAN_NET
the router has dhcp enabled, giving by default ip's from LAN_NET and using the default gw, RDS
I have snat for the LAN_NET to go through RDS.
If i enter an ip from the ILAN_NET, instead of routing in through the INES_GW, it also goes through RDS_GW.
the routing i've used for about 5 months has worked perfectly untill one day, when it just stopped. this is my setup:
ip route add $RDS_MASK dev $RDS_IF src $RDS_IP table rds
ip route add default via $RDS_GW table rds
ip route add $INES_MASK dev $INES_IF src $INES_IP table ines
ip route add default via $INES_GW table ines
ip route add default via $RDS_GW
ip rule add from $RDS_IP table rds
ip rule add from $INES_IP table ines
ip route add $LAN_NET dev $LAN_IF table rds
ip route add 127.0.0.0/8 dev lo table rds
ip route add $ILAN_NET dev $ILAN_IF table ines
ip route add 127.0.0.0/8 dev lo table ines
what puzzles me the most is that this setup has worked, and now it doesn't .... without any changes on the router.
I've tried everything save for a format/reinstall.
Is there a better/different way to do this?
well, i have checked the hardware stuff.
The cables, the connection to both isp, the NIC's are all ok because the RDS uplink works fine, the INES uplink works if i plug it in another computer.
I can ssh on both eth0 and eth1 ip's from outside.
As i've said, if i traceroute from my pc, in which i've put a INES ip from the subnet i have, the pacakges go throuh rds gateway.
Let me give you the figures ( for obvious reasons i will use generic ip's ):
auto eth0 (this is the rds uplink)
iface eth0 inet static
auto eth1 (this is the ines uplink)
iface eth1 inet static
auto eth2 (this is the LAN interface)
iface eth2 inet static
auto eth2:1 (this is the INES subnet routed through the ines uplink)
iface eth2:1 inet static
The ip routes are in the first post.
router:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
126.96.36.199 0.0.0.0 255.255.255.248 U 0 0 0 eth2
188.8.131.52 0.0.0.0 255.255.255.128 U 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
184.108.40.206 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 220.127.116.11 0.0.0.0 UG 0 0 0 eth0
router:~# ip route show
18.104.22.168/29 dev eth2 proto kernel scope link src 22.214.171.124
126.96.36.199/25 dev eth1 proto kernel scope link src 188.8.131.52
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.1
184.108.40.206/24 dev eth0 proto kernel scope link src 220.127.116.11
default via 18.104.22.168 dev eth0
Could this problem be related to a cache of the routes?
The fast solution would be to reinstall the whole system and be done with it. But if this happens again after 5-6 months... i don't want to make a habbit out of it