netmask 255.255.255.255 vs ip route add via ... (bug?)

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings routing folks,

I want to use the netmask 255.255.255.255 to insulate (not quite isolate) machines on a shared subnet from each other. This works just fine on win XP, but Linux iproute will not acccept the gateway address in one step -- neither on the command line nor via DHCP:

Here's the interface, set up with a netmask of /32:

    # ip addr
    ...
    2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
        link/ether 00:08:74:48:1f:0c brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.6/32 brd 192.168.1.255 scope global eth0
        inet6 fe80::208:74ff:fe48:1f0c/64 scope link
           valid_lft forever preferred_lft forever
    ...

And here's me trying to add the route:

    # ip route add default via 192.168.1.17
    RTNETLINK answers: Network is unreachable

Hmm ... erk ... workaround ... add a host route first, then add it as a default route ...

    # sudo ip route add 192.168.1.17 dev eth0
    # sudo ip route add default via 192.168.1.17

And this is what we get ... (yep, it works)

    # ip route ls
    192.168.1.17 dev eth0  scope link
    default via 192.168.1.17 dev eth0

But wait! We can delete the host route! And it works just fine (you *can* try this at home folks).

    # sudo ip route del 192.168.1.17
    # ip route ls
    default via 192.168.1.17 dev eth0

So why did we need that host route?

It should be possible to add the gateway directly, or it should be impossible to delete it once something "depends" on it. The current behaviour seems a little unbalanced (and, for my strange purposes, inconvenient :)

  Tested on Ubuntu 6.06 Dapper (Kernel: 2.6.15, iproute2 20041019)
  Looks the same on Fedora Core 3, (Kernel 2.6.11.8, iproute2 2.6.9)

&:-)


--
Disclaimer: this disclaimer and your base are us
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux