Routing issues with dual interfaces on debian server
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
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.
After several weeks of trying to resolve this issue, I finally turn to you for help... I simply can't figure out what the problem is due to lacking knowledge of routing in linux.
Setup:
A debian server with dual network interfaces.
An office network with a few workstations and laptops on the internal interface (eth0)
An external network with several other offices on the external (eth1)
Computers on the internal net are using win/mac
Symptoms:
Connection is very slow, dropping packages. Music can't be played over the network, samba copies files at 1 MB/s at most. SCP with filezilla is even slower. Problem occurs on all computers trying to copy files from the server. Samba does not seem to be the issue, neither is router (tried with replacement). SHutting down the external interface and trying does not do anything to help the speed.
Configurations:
This is what 'route' gives:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
130.236.246.0 * 255.255.255.0 U 0 0 0 eth1
default fuego.ks.liu.se 0.0.0.0 UG 0 0 0 eth1
(fuego is the external nets firewall to the outside world, internet)
This is what 'route -C' gives:
Kernel IP routing cache
Source Destination Gateway Flags Metric Ref Use Iface
ko.stuff.liu.se 130.236.246.255 130.236.246.255 ibl 0 0 17 lo
192.168.0.42 Klas.forte Klas.forte 0 1 0 eth0
192.168.0.42 Klas.forte Klas.forte 0 1 0 eth0
Klas.forte 192.168.0.42 192.168.0.42 il 0 0 29 lo
192.168.0.42 unknown.forte unknown.forte 0 0 0 eth0
ypsilon.y.linte 130.236.246.255 130.236.246.255 ibl 0 0 0 lo
register.shgo.s 130.236.246.255 130.236.246.255 ibl 0 0 17 lo
130.236.246.57 130.236.246.255 130.236.246.255 ibl 0 0 13 lo
130.236.246.253 130.236.246.255 130.236.246.255 ibl 0 0 0 lo
130.236.246.84 130.236.246.255 130.236.246.255 ibl 0 0 44 lo
130.236.246.213 130.236.246.255 130.236.246.255 ibl 0 0 3 lo
unknown.forte 192.168.0.42 192.168.0.42 il 0 0 9 lo
192.168.0.42 unknown.forte unknown.forte 0 0 8 eth0
130.236.246.59 130.236.246.255 130.236.246.255 ibl 0 0 6 lo
ek-xtra1.ks.liu 130.236.246.255 130.236.246.255 ibl 0 0 0 lo
130.236.246.209 ALL-SYSTEMS.MCA ALL-SYSTEMS.MCA ml 0 0 0 lo
foo63.shgo.stud 255.255.255.255 255.255.255.255 ibl 0 0 1 lo
localhost localhost localhost l 0 0 1 lo
130.236.246.58 130.236.246.255 130.236.246.255 ibl 0 0 13 lo
localhost localhost localhost l 0 0 1 lo
As you can see, routs to several other offices also appear (ypsilon, xtra1, foo63 etc). Why?
For some reason, i wonder why so many routes are going through the lo, can this be causing any problems?
Anything else you would like to see that can determine the problem with the routing?
It seems nothing is sent to default gw, eth1.
* What ip do you get for fuego.ks.liu.se, what is in your /etc/hosts?
* Can you reach fuego.ks.liu.se - try pinging for example.
* You could try to remove and add back default gateway
If i can read it right, it seems like the internal interface does not have any gateway. I know we earlier had a problem with having dual gateways so the internal one was removed.
This is done in /etc/network/interfaces, the gateway part is commented out (used to be 192.168.0.1).
perhaps i should add it back again and configure the routes somehow, but how?
it seems like the internal interface does not have any gateway
No defaultgateway for eth0, which is correct. The line
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
tells where packets to internal network shall go.
Do not add eth0 as default gateway!
The routing cache is wrong, however. Should clear itself after a while, try clearing it manually. I don't know how unfortunately, you'll have to search a bit.
I just flushed the cache with
'ip route flush cache'
and it looks a bit more "normal":
Source Destination Gateway Flags Metric Ref Use Iface
192.168.0.42 unknown.forte unknown.forte 0 0 6 eth0
* 255.255.255.255 255.255.255.255 bl 0 0 1 lo
register.shgo.s 130.236.246.255 130.236.246.255 ibl 0 0 1 lo
fuego.ks.liu.se patapata.forte. patapata.forte. il 0 0 0 lo
patapata.forte. h-60-198.A163.p fuego.ks.liu.se 0 1 0 eth1
192.168.0.42 unknown.forte unknown.forte 0 0 6 eth0
uu1.stuff.liu.s 130.236.246.255 130.236.246.255 ibl 0 0 1 lo
130.236.246.58 130.236.246.255 130.236.246.255 ibl 0 0 16 lo
130.236.246.245 ALL-SYSTEMS.MCA ALL-SYSTEMS.MCA ml 0 0 0 lo
unknown.forte 192.168.0.42 192.168.0.42 il 0 0 16 lo
130.236.246.84 130.236.246.255 130.236.246.255 ibl 0 0 14 lo
h-60-198.A163.p patapata.forte. patapata.forte. l 0 0 83 lo
foo63.shgo.stud 255.255.255.255 255.255.255.255 ibl 0 0 0 lo
although the entry for interface eth0 is added two time.. but since it's actually the same route, there shouldn't be any problems i hope.
BUT
a few minutes later i notice that the routing cache is HUGE one again and that the speed of the network is slow. The routing cache is now much bigger than before, i have six entries for eth0, two for eth0 and 42 for lo... is this normal in any way?
This is really strange, I'm stumbling in the dark.
Let's get some more info, maybe it'll help. Send output of:
# ifconfig
# arp -v
And that host 127.0.1.1 satasata.forte satasata
you have in /etc/hosts, is that really correct? Kinda strange adress really. I'm wrong here, standard adress of your computer. Forget about this.
(Btw, the routing cache gets large, that's ok. It's kind of a quick-list of connections, once a path is found that path is entered in the cache for faster routing next time.)
Last edited by pingu; 09-17-2009 at 04:11 PM..
Reason: Correcting myself
Also post /etc/network/interfaces
What is the netmask for fuego.ks.liu.se - 130.236.246.1 ?
From your computer - or any connected to internal network - do a traceroute to server.
I don't really know what I'm looking for, just hoping to find something.
I am really concerned about lines like these:
30.236.246.58 130.236.246.255 130.236.246.255 ibl 0 0 16 lo
Why is gateway adress .255 and not .1? Should be 130.236.246.1 and interface eth1! 130.236.246.255 is (normally) broadcast adress, this puzzles me.
traceroute 130.236.246.1
traceroute to 130.236.246.1 (130.236.246.1), 30 hops max, 40 byte packets
1 130.236.246.1 (130.236.246.1) 0.336 ms 1.414 ms 0.212 ms
traceroute from a client on the internal net to the server only goes through one jump, to server directly:
C:\Users\Forte>tracert 192.168.0.42
Spårar väg till SATASATA [192.168.0.42] över högst 30 hopp:
1 <10 ms <10 ms <10 ms SATASATA [192.168.0.42]
------------------------------
As you said, the .255 gateway seems wierd, since the gateway is configured as .1 in /etc/network/interfaces
Where does that information come from? Is someone getting a wrong gateway address from somewhere else?
Meanwhile.. i still can't find any problems. Also asked the admins for the bigger net if they have any input on the configurations of the nets.
See? Check the lines I put in italics: With netmask 255.255.255.0 the network shall be 130.236.246.0!
This probably occurred because 130.x.x.x as standard is a class B network (meaning per default the network in your case is 130.236.0.0). However you are using it as a class C - which is quite ok and very common. But you must then change the network adress to 130.236.246.0.
Change that line in /etc/network/interfaces and restart network. Hopefully the problems will be gone.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.