Benjamin Girard(benjamin.gir...@kambi.com) on 2019.08.22 12:35:08 +0000:
> Hi,
> 
> 
> I have the following machine with two interfaces like this:
> 
> root@fw:~ # cat /etc/hostname.vlan10
> vlan 10 vlandev vio0

shoudl be 'vnetid 10 parent vio0'

> inet 10.0.0.1 255.255.255.0 NONE
> up
> 
> root@fw:~ # cat /etc/hostname.vlan23
> vlan 23 vlandev vio0

should be 'vnetid 23 parent vio0'

> inet 172.30.133.83 255.255.255.240 NONE
> !route add 10.0.0.10/32 172.30.133.84
> up
> 
> now the problem is that if i start pinging 10.0.0.10 before my vlan23 is up 
> and has inserted the static route, the openbsd machine will insert another 
> route like this:
> 
> root@fw:~ $ route -n show | grep 10.0.0.10
> 10.0.0.10        link#12            UHLc       0       78     -     3 vlan10
> 
> then if I netstart vlan23 the static route will be inserted but with a lower 
> priority:
> 
> kmbops@fw:~ $ route -n show | grep 209.43.38.6
> 10.0.0.10        link#12            UHLc       0       78     -     3 vlan10
> 10.0.0.10        172.30.133.84      UGHS       0        0     -     8 vlan23
> 
> Eventually this first route inserted will disappear if i stop pinging the
> ip, or will not at all exist in the first place if i don't try to reach
> that ip before inserting the static route, but my question is: Is it the
> expected behavior?

Yes.

> Why does this route get inserted while there is already a route for the
> full 10.0.0.0/24 subnet existing anyway?

Simplified, this is how the network stack stores the information that it is
trying to find the link-local address of 10.0.0.10 on that link (by sending
arp requests).

If you run OpenBSD 6.5 or newer, you can try to solve your problem by
renaming the vlan23 hostname.if file:

 mv /etc/hostname.vlan23 /etc/hostname.vlan1

Then it will be created before vlan10, and things should just work.

Reply via email to