All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] netmask 255.255.255.255 vs ip route add via ... (bug?)
@ 2006-11-14 13:48 Andrew McGill
  2006-11-14 18:25 ` Flechsenhaar, Jon J
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Andrew McGill @ 2006-11-14 13:48 UTC (permalink / raw)
  To: lartc

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@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-11-15 14:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-14 13:48 [LARTC] netmask 255.255.255.255 vs ip route add via ... (bug?) Andrew McGill
2006-11-14 18:25 ` Flechsenhaar, Jon J
2006-11-14 18:53 ` Pio Mendez
2006-11-15  1:48 ` Martin A. Brown
2006-11-15 12:27 ` Alexandru Dragoi
2006-11-15 14:04 ` Martin A. Brown
2006-11-15 14:20 ` Andrew McGill

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.