Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've inherited administration duties for a firewall/gateway server, and I'm trying to understand what a particular static route setup in rc.local means:

...
route add 123.123.123.123/30 10.10.3.14
route add 123.123.123.123/32 10.10.3.13
...

Obviously, the IP addresses have been changed to protect the innocent.

What does this mean, and why is it routed this way?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

It means packets for 123.123.123.120-122 will go via 10.10.3.14 and packets for 123.123.123.123 will go via 10.10.3.13.

  • Since the advent of CIDR, netmasks indicate the length of the prefix - technically any IP in the network can be used, but by convention the non-masked bits are set to 0, which is why 'network addresses' are always on even numbers.

  • Most specific wins - /32 is more specific (longer) than /30, so it takes precedence over the /30.

share|improve this answer
add comment

First line: packets to hosts at 123.123.123.123/30 are routed via 10.10.3.14, except (second line) for packets to 123.123.123.123/32, which are routed via 10.10.3.13.

However, I suspect a anonymization error, if you really define a /30 network, the first address (same ip/32) is the "network"-address, which doesn't really get packets. It could also be, that someone tries to route a slice out of a bigger subnet differently, but it smells funny...

share|improve this answer
    
it's not the network-address it's the broadcast address... odd numbers are as far as I know never net addresses. A better notation for the network would be 123.123.123.120/30. –  Marcel G Sep 29 '10 at 1:06
2  
The IP addresses were chosen for obfuscation purposes, I didn't realize that the oddness/evenness would be such a red herring to people. –  Chris R Sep 30 '10 at 14:42
add comment

Are the "123.123.123.123" addresses really the exact same in the setup you are debugging - or are they slightly different?

Assuming they are different - the first line means that anything in the network defined by 123.123.123.123/30 should be forwarded to 10.10.3.14. The second line means the specific IP address 123.123.123.123 should be forwarded to 10.10.3.13.

As to why - we'd need more context.

  • Can you tell me the last octet (the last .123) specifically - what exactly is it in your situation. Having two of htem the same with two different netmasks is a bit weird, and could mean a couple of different things....
share|improve this answer
    
They're the same, exactly. –  Chris R Sep 28 '10 at 22:18
    
What context might you need to answer these questions? And what does it mean when the two IPs are the same? –  Chris R Sep 28 '10 at 22:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.