Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]routing problem (rogue entry in routing table)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
SilverOne
Apprentice
Apprentice


Joined: 10 Nov 2003
Posts: 161

PostPosted: Sat Aug 06, 2005 3:24 pm    Post subject: [solved]routing problem (rogue entry in routing table) Reply with quote

Hi everyone,

I've got 2 servers running Gentoo (happily I might add). Now they both share most of their configuration (one machine replaced the other), and now that I have one at my desk for upgrading/testing/etc I'd like to solve a little annoyance:

Both machines have a routing problem, this is the routing table after a reboot:
Code:

> route -n
Destination     Gateway      Genmask            Flags    Iface
83.219.66.0    0.0.0.0       255.255.255.0     U         eth0
83.0.0.0       0.0.0.0       255.0.0.0         U         eth0
127.0.0.0      127.0.0.1     255.0.0.0         UG        lo
0.0.0.0        83.219.66.1   0.0.0.0           UG        eth0

(I left out the Metric, Ref and Use colums, all entries of those were 0 (zero))

Now most of those entries seem fine to me, but I think it is implying that 83.0.0.0 is a local network, causing all those packets not to be routed via the gateway.
I have a number of visitors on my servers from 83.x.x.x addresses located on the internet.
Currently I manually delete the rogue entry by issuing this command after every reboot:
Code:

> route del -net 83.0.0.0 netmask 255.0.0.0

which removes it, and solves the problem. Now I don't reboot often, so it's not really a problem, but it is still annoying.

But I don't know where that entry is coming from. Could anyone help me here?
I suppose you'll need the following info:

/etc/conf.d/net: (stripped all comments for clarity)
Code:

iface_eth0="83.219.66.Y broadcast 83.219.66.255 netmask 255.255.255.0"
alias_eth0="83.219.66.Y+1 83.219.66.Y+2 83.219.66.Y+3 83.219.66.Y+4 83.219.66.Y+5 83.219.66.Y+6 83.219.66.Y+7 83.219.66.Y+8 83.219.66.Y+9"
gateway="eth0/83.219.66.1"

(replaced my actual address with Y and Y+1, Y+2 etc )

I'm grateful for any ideas/tips/etc.
If I can supply more info, just let me know


Last edited by SilverOne on Sun Aug 07, 2005 8:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55015
Location: 56N 3W

PostPosted: Sat Aug 06, 2005 5:52 pm    Post subject: Reply with quote

SilverOne,

Its this line.
Code:
iface_eth0="83.219.66.Y broadcast 83.219.66.255 netmask 255.255.255.0"

The netmask is wrong unless you have all 256 IP addesses on 83.219.66.x
The broadcast is suspect too, unless your happen to have that 256 IP subnet or the last part of it.

e.g. I have a /29. My net address ends in .136 and my broadcast is ends in .143
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
SilverOne
Apprentice
Apprentice


Joined: 10 Nov 2003
Posts: 161

PostPosted: Sat Aug 06, 2005 11:29 pm    Post subject: Reply with quote

Hi, thanks for answering.

I "only" have 10 addresses, so the mask is wrong indeed.
The reason I'm using it, is because I don't know what other addresses are being used by local machines (on the same switch as I am).
Anyhow, the line you quoted:
Code:

iface_eth0="83.219.66.Y broadcast 83.219.66.255 netmask 255.255.255.0"

I can see how it causes the 83.219.66.0 entry (with genmask 255.255.255.0) but not how it creates the 83.0.0.0 entry.

Also I understand /29 as being an address mask with the 29 least significant bits variable. (which would mean nearly all possible addresses)
Could you please explain the relation between /29 .136 and .143 to me?
(my networking knowledge is a bit rusty :( )

Thanks a lot!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55015
Location: 56N 3W

PostPosted: Sat Aug 06, 2005 11:54 pm    Post subject: Reply with quote

SilverOne,

/29 means the network address is 29 bits leave 3 bits for hosts.
The network address is the lowest IP in your subnet and always ends with one or more binary zeros.
In my case, with 3. 136 is 1000 1000
The broadcast address is by tradition, the highest IP in the subnet, which for me, is 143 or 1000 1111
Someone elses network starts at 144, which is 1001 0000. That may be either a /28 or a /29.
/30 is never used. It wouldl be a block of 4 IPs of which only two could be allocated to hosts.

My netmask is 255.255.255.248, which is equilvelent to /29

So I may write
Code:
route add -net x.y.z.136/29 gw ...
to point something at my public subnet.

With 10 IPs you are in a bit of a mess - Its not a complete subnet. Subnets are always 2^n IP addresses, so that would be 8 (a /29) or 16 (a /28)
Do you have a subnet at all?

I missed your
Code:
83.0.0.0       0.0.0.0       255.0.0.0         U         eth0
when I responded first. I cannot spot what causes that.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
SilverOne
Apprentice
Apprentice


Joined: 10 Nov 2003
Posts: 161

PostPosted: Sun Aug 07, 2005 9:24 am    Post subject: Reply with quote

Hmmm... indeed that must be why everybody frowns when I say I've got 10 addresses :)
But I do. I guess that's due to the inexperience of the person who gave them to me....

So that would explain the odd (large) subnet that I seem to claim. Though that should only affect communication with other machines with 83.219.66.XXX addresses, right?

I'm thinking it may have something to do with the aliasses. I'm not setting explicit broadcast/netmask settings for the aliases. Could it be that the assumed default is 83.0.0.0 as the netmask?
If so, (or to rule it out), how do I set the aliases to fixed broadcast/netmask settings? I didn't understand the syntax used as an example in the default /etc/conf.d/net file.

I think I had your /29 confused with mask settings that are used in other places (samba / iptables configuration) where /8 means a whole subnet (i.e. the last 8 bits always match).
Thanks for clearing that up for me. Also the broadcast explanation helps a lot!

Thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55015
Location: 56N 3W

PostPosted: Sun Aug 07, 2005 10:14 am    Post subject: Reply with quote

SilverOne,

Play here http://jodies.de/ipcalc
Read here http://www.pku.edu.cn/academic/research/computer-center/tc/html/TC0302.html and following pages.
The 83.x.x.x is a class A network so its defualt netmask is indeed 255.0.0.0

I don't use aliaes so I don't know the syntax for them in /etc/conf.g/net. However, there at three different sets of syntax rules out there, depending on which version of baselayout you have.

If you got your IPs from an ISP, you would get a subnet, then the admin is your problem.
If you got them from a network admin, then 10 is OK but the admin should have told you whet network address and broadcast to use too, since you were just allocated 10 IPs to use in a larger network you have no control over.

You need to ask whoever allocated you the IPs for the mising information.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Sun Aug 07, 2005 4:04 pm    Post subject: Reply with quote

Linuix will tend to default to old classful behavior when you don't specify the subnet. I recently did something similar to what you're doing and got the full class A showing up in the routing table even through the real address had been configure correctly as part of a /24. You'll need to specify the netmask and broadcast for each IP you add or you'll get the 83.0.0.0 again.

Also if you check your ifconfig output you'll see that the interfaces you originally added have a netmask of 255.0.0.0 and broadcast of 83.255.255.255.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
SilverOne
Apprentice
Apprentice


Joined: 10 Nov 2003
Posts: 161

PostPosted: Sun Aug 07, 2005 8:06 pm    Post subject: Reply with quote

Right.
Thanks for the links, it certainly helped!

I think now that it is indeed the default behaviour that is assigned to the aliases (which I don't specifically limit to a particular subnet) which causes the problems
kashani wrote:

Also if you check your ifconfig output you'll see that the interfaces you originally added have a netmask of 255.0.0.0 and broadcast of 83.255.255.255.

Correct.
ifconfig shows the correct (well, the 256 address subnet) settings for eth0, while it assigns the full 83 class A to each alias.
My guess is that finding the correct syntax for supplying broadcast/subnet settings for aliases will solve the problem.

I'll go look for the correct syntax now, and report back.

Thanks to both of you for helping!
Back to top
View user's profile Send private message
SilverOne
Apprentice
Apprentice


Joined: 10 Nov 2003
Posts: 161

PostPosted: Sun Aug 07, 2005 8:35 pm    Post subject: Reply with quote

Solved!
The syntax for the broadcast/netmask settings of the aliases was actually quite simple: just create the settings like so:

Code:

broadcast_eth0="83.219.66.255 83.219.66.255  "  and so on for all aliases (so 9 times in my case)
netmask_eth0="255.255.255.0 255.255.255.0 " and so on (once for every alias.  9 in my case)


Ofcourse this is not 100% correct as this assumes that all 83.219.66.X addresses belong to my local network.
I'm not sure what the exact settings should be, I should clear that up with my network provider.
But at least it prevents the complete 83.X.X.X net to be seen as the local network!

Thanks again, this solved it!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum