[Xorp-users] Multiple IPs for one interface

Pavlin Radoslavov pavlin at icir.org
Mon Nov 20 12:15:16 PST 2006


> I have two networks connected to my internal interface (137.226.108.0/22
> and 134.130.48.0/23). I can't get Xorp to do IGMP (and PIM) for both
> interfaces. With automatic configuration only one of many IPs (so only
> one net) is detected. With a static configuration and two VIFs I always
> get "bad vif name". I can't find any information what a _good_ VIF name
> is, so please tell me. "neuesnetz" and "altesnetz" (German, new and old
> network) do not work. Even eth0 and eth0b do not work, although a
> similiar example is in the PDF user manual. Please tell me how to use
> Xorp with several IPs per interface.

Assuming the interface name with the two IP addresses is eth0, you
can use one of the following two configurations to configure it with
multiple IP addresses.
Note that I have randomly chosen 137.226.108.1 and 134.130.48.1 as
your real IP addresses, because the 137.226.108.0 and 134.130.48.0
addresses themselves shouldn't be used (the subnet bits are all
0s).

/*
 * Method 1: reuse all addresses that have been configured before
 * starting XORP.
 */
interfaces {
    interface eth0 {
        default-system-config
    }
}

/*
 * Method 2: explicitly assign the IP addresses.
 */
interfaces {
    interface eth0 {
        vif eth0 {
            address 137.226.108.1 {
                prefix-length: 22
            }
            address 134.130.48.1 {
                prefix-length: 23
            }
        }
    }
}

To test that the multi-address configuration really works, I'd
recommend that you start XORP with only one of the above two
configurations. Then the "show interfaces" xorpsh command should
show both addresses. Double check with the Linux "ip addr" command.
Note that the Linux "ifconfig -a" command is broken and won't
display the secondary IP address.

After that you can configure the rest of XORP as usual. E.g., the
MFEA part will look like:

plumbing {
    mfea4 {
        interface eth0 {
            vif eth0 {
                disable: false
            }
        }
        interface register_vif {
            vif register_vif {
                disable: false
            }
        }
    }
}


Hope that helps,
Pavlin



More information about the Xorp-users mailing list