On Mon, Jan 30, 2012 at 5:36 AM, Dan Shechter <dans...@gmail.com> wrote:
> Hi All. > > I have noticed something regarding routing, and I want to make sure its > the expected behavior. > > Lets say I have interface em0 with IP 10.1.1.10/24 and a default route of > 10.1.1.1, then I change em0 IP to 10.1.1.10/31 then change it back to > 10.1.1.10/24. > > I have noticed that my OBSD 5.0 does not use the default route. I see the > default route in "netstat -nr" and in "route show", but my machine is not > using it. > > Then when I do : "route del default" "route add default 1.1.1.1", my > machine starts using the default route again. > > Is that normal and to be expected? > > Best regards, > Dan > > The same behavior verified by some member of #openbsd, and he suggested posting some output. Thanks to tmux, I have a record of showing the routeing table right after changing the route from /31 to /24. And then after removing and adding the default route. Notice that the addresses in this output are using the 10.0.123.0/24network: ~$ netstat -r Routing tables Internet: Destination Gateway Flags Refs Use Mtu Prio Iface default 10.0.123.1 UGS 1 60497 - 8 em0 10.0.123/24 link#1 UC 2 0 - 4 em0 10.0.123.1 00:1e:52:f6:5a:1a UHLc 0 90 - 4 em0 10.0.123.11 00:1b:63:cb:95:63 UHLc 1 1091 - 4 em0 10.0.124.202/31 link#4 C 0 0 - 4 em3 loopback localhost UGRS 0 0 33196 8 lo0 localhost localhost UH 0 8736 33196 4 lo0 BASE-ADDRESS.MCAST localhost URS 0 0 33196 8 lo0 Internet6: Destination Gateway Flags Refs Use Mtu Prio Iface ::/104 localhost UGRS 0 0 - 8 lo0 ::/96 localhost UGRS 0 0 - 8 lo0 localhost localhost UH 14 0 33196 4 lo0 ::127.0.0.0/104 localhost UGRS 0 0 - 8 lo0 ::224.0.0.0/100 localhost UGRS 0 0 - 8 lo0 ::255.0.0.0/104 localhost UGRS 0 0 - 8 lo0 ::ffff:0.0.0.0/96 localhost UGRS 0 0 - 8 lo0 2002::/24 localhost UGRS 0 0 - 8 lo0 2002:7f00::/24 localhost UGRS 0 0 - 8 lo0 2002:e000::/20 localhost UGRS 0 0 - 8 lo0 2002:ff00::/24 localhost UGRS 0 0 - 8 lo0 fe80::/10 localhost UGRS 0 0 - 8 lo0 fe80::%em0/64 link#1 UC 0 0 - 4 em0 fe80::200:24ff:fec 00:00:24:ce:97:48 UHL 0 0 - 4 lo0 fe80::%em1/64 link#2 UC 0 0 - 4 em1 fe80::200:24ff:fec 00:00:24:ce:97:49 UHL 0 0 - 4 lo0 fe80::%em2/64 link#3 UC 0 0 - 4 em2 fe80::200:24ff:fec 00:00:24:ce:97:4a UHL 0 0 - 4 lo0 fe80::%em3/64 link#4 C 0 0 - 4 em3 fe80::200:24ff:fec 00:00:24:ce:97:4b HL 0 0 - 4 lo0 fe80::%lo0/64 fe80::1%lo0 U 0 0 - 4 lo0 fe80::1%lo0 link#6 UHL 0 0 - 4 lo0 fec0::/10 localhost UGRS 0 0 - 8 lo0 ff01::/16 localhost UGRS 0 0 - 8 lo0 ff01::%em0/32 link#1 UC 0 0 - 4 em0 ff01::%em1/32 link#2 UC 0 0 - 4 em1 ff01::%em2/32 link#3 UC 0 0 - 4 em2 ff01::%em3/32 link#4 C 0 0 - 4 em3 ff01::%lo0/32 fe80::1%lo0 UC 0 0 - 4 lo0 ff02::/16 localhost UGRS 0 0 - 8 lo0 ff02::%em0/32 link#1 UC 0 0 - 4 em0 ~$ sudo route delete default delete net default ~$ sudo route add default 10.0.123.1 add net default: gateway 10.0.123.1 ~$ route show Routing tables Internet: Destination Gateway Flags Refs Use Mtu Prio Iface default 10.0.123.1 UGS 0 0 - 8 em0 10.0.123/24 link#1 UC 2 0 - 4 em0 10.0.123.1 00:1e:52:f6:5a:1a UHLc 2 104 - 4 em0 10.0.123.11 00:1b:63:cb:95:63 UHLc 1 1209 - 4 em0 10.0.124.202/31 link#4 C 0 0 - 4 em3 loopback localhost UGRS 0 0 33196 8 lo0 localhost localhost UH 0 8736 33196 4 lo0 BASE-ADDRESS.MCAST localhost URS 0 0 33196 8 lo0 Internet6: Destination Gateway Flags Refs Use Mtu Prio Iface ::/104 localhost UGRS 0 0 - 8 lo0 ::/96 localhost UGRS 0 0 - 8 lo0 localhost localhost UH 14 0 33196 4 lo0 ::127.0.0.0/104 localhost UGRS 0 0 - 8 lo0 ::224.0.0.0/100 localhost UGRS 0 0 - 8 lo0 ::255.0.0.0/104 localhost UGRS 0 0 - 8 lo0 ::ffff:0.0.0.0/96 localhost UGRS 0 0 - 8 lo0 2002::/24 localhost UGRS 0 0 - 8 lo0 2002:7f00::/24 localhost UGRS 0 0 - 8 lo0 2002:e000::/20 localhost UGRS 0 0 - 8 lo0 2002:ff00::/24 localhost UGRS 0 0 - 8 lo0 fe80::/10 localhost UGRS 0 0 - 8 lo0 fe80::%em0/64 link#1 UC 0 0 - 4 em0 fe80::200:24ff:fec 00:00:24:ce:97:48 UHL 0 0 - 4 lo0 fe80::%em1/64 link#2 UC 0 0 - 4 em1 fe80::200:24ff:fec 00:00:24:ce:97:49 UHL 0 0 - 4 lo0 fe80::%em2/64 link#3 UC 0 0 - 4 em2 fe80::200:24ff:fec 00:00:24:ce:97:4a UHL 0 0 - 4 lo0 fe80::%em3/64 link#4 C 0 0 - 4 em3 fe80::200:24ff:fec 00:00:24:ce:97:4b HL 0 0 - 4 lo0 fe80::%lo0/64 fe80::1%lo0 U 0 0 - 4 lo0 fe80::1%lo0 link#6 UHL 0 0 - 4 lo0 fec0::/10 localhost UGRS 0 0 - 8 lo0 ff01::/16 localhost UGRS 0 0 - 8 lo0 ff01::%em0/32 link#1 UC 0 0 - 4 em0 ff01::%em1/32 link#2 UC 0 0 - 4 em1