Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Normally, I would just keep trying to figure this out on my own, but I'm really at my wits' end. I have a server with two Ethernet adapters, eth0 and eth1. I've been assigned a /29 subnet that technically ranges from xxx.xxx.xxx.248 to xxx.xxx.xxx.255, but the only usable address are from .250 to .254. For some reason .248 is reserved, and .249 is the default gateway.

At first, I tried ip addr add xxx.xxx.xxx.248/29 dev eth0 broadcast + and ip addr add xxx.xxx.xxx.248/29 dev eth1 broadcast +, hoping that Linux would be intelligent and assign itself different address in the block. However, both of the addresses it chose were the restricted .248 address, so that's obviously not right.

Then I did ip addr add xxx.xxx.xxx.250/29 dev eth0 broadcast + and ip addr add xxx.xxx.xxx.251/29 dev eth1 broadcast +, which seemed to work, so I followed it with ip route add default via xxx.xxx.xxx.249. However, pinging .249 resulted in "Destination Host Unreachable" so I've clearly done something wrong. I also attempted the same thing using ifconfig and route, but got the same results, so there's clearly something I'm not understanding.

What do I need to do?

share|improve this question
    
xxx.xxx.xxx.248 is reserved in a /29 subnet for the same reason xxx.xxx.xxx.0 is reserved in a /24 (Class C) subnet -- it has a host number of 0 (or “all 0s”, looking at it bitwise) and so it is the address of the network as a whole, and so cannot be used for a host. –  Scott Nov 20 '13 at 0:56

2 Answers 2

up vote 2 down vote accepted

The CRUX documentation has some configuration examples.

EDIT: Set the broadcast explicitly in the ip command:

ip addr add xxx.xxx.xxx.250/29 dev eth0 broadcast xxx.xxx.xxx.255

According to the ip documentation, it does try to guess but it's probably best to eliminate moving parts.

Then bring up the adapter with:

ip link set eth0 up

Try doing a tcpdump (if you can) of traffic going out to your gateway:

tcpdump host xxx.xxx.xxx.249

share|improve this answer
    
I've been making pretty extensive use of those, actually. Unfortunately, doing that for both eth0 and eth1 didn't fix anything. –  Andy Shulman Jul 3 '12 at 4:08
    
Try the same command, but specify the netmask? I can't think of anything else except that it wants to use classful network masks for some utterly broken reason. –  Joel E Salas Jul 3 '12 at 4:10
    
I'm not sure how to add the netmask to ip link and the help doesn't have anything. Would you mind posting the command? –  Andy Shulman Jul 3 '12 at 4:15
    
Set the broadcast equal to the netmask? Did you really mean that? –  Andy Shulman Jul 3 '12 at 4:24
    
Oops! Fixing the answer –  Joel E Salas Jul 3 '12 at 4:26

There is no problem in the ip addr command.

The issue is that you are applying an IP that belongs to the same subnet on different interfaces. Check the following:

  1. Cables should be connected on the same subnet (both of them, because this is what it seems you want to do).
  2. Check routing tables netstat -rn. Identify which interface it is using to communicate with it.

Your ping cannot properly ARP the MAC and cannot determine the interface to use to ping the gateway, probably because of a routing issue or the cable is disconnected.

If cables are properly connected, delete the auto generated route for that subnet.

share|improve this answer

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.