# Help with ROUTE_MPATH. Never worked? + then panic/reboot



## varda (Jul 17, 2021)

Hello Gentlemen.

Please help/clarify me with usage of kernel 'option ROUTE_MPATH' and multiroutes. I'm on vanilla13-STABLE, everything as after default setup.

```
# uname -a
FreeBSD server.localnetwork 13.0-STABLE FreeBSD 13.0-STABLE #0: Wed Jul  7 01:15:25 +05 2021     me@server.local/usr/obj/usr/src-13/amd64.amd64/sys/GENERIC  amd64
```
Trying as follow:

```
route -nv add 87.250.250.242 10.1.1.1
route -nv change -sticky 87.250.250.242 10.1.1.1
route -nv change -weight 10 87.250.250.242 10.1.1.1
route -nv get 87.250.250.242 10.1.1.1

route -nv add 87.250.250.242 10.2.2.2
route -nv change -sticky 87.250.250.242 10.2.2.2
route -nv change -weight 20 87.250.250.242 10.2.2.2
route -nv get 87.250.250.242 10.2.2.2
```
But never got it working:

```
# route -nv get 87.250.250.242 10.1.1.1
RTA_DST: inet 87.250.250.242; RTA_GATEWAY: inet 10.1.1.1; RTA_IFP: link ; RTM_GET: Report Metrics: len 240, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,HOST,STATIC>
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP>
 87.250.250.242 10.1.1.1 link#0
   route to: 87.250.250.242
destination: 87.250.250.242
    gateway: 10.1.1.1
        fib: 0
  interface: ue0
      flags: <UP,GATEWAY,HOST,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         0         0

locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 87.250.250.242 10.1.1.1 ue0:0.e0.4c.69.1f.99 10.10.10.10

# route -nv get 87.250.250.242 10.2.2.2
RTA_DST: inet 87.250.250.242; RTA_GATEWAY: inet 10.2.2.2; RTA_IFP: link ; RTM_GET: Report Metrics: len 240, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,HOST,STATIC>
locks:  inits:
sockaddrs: <DST,GATEWAY,IFP>
 87.250.250.242 10.2.2.2 link#0
   route to: 87.250.250.242
destination: 87.250.250.242
    gateway: 10.2.2.2
        fib: 0
  interface: ue0
      flags: <UP,GATEWAY,HOST,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         0         0

locks:  inits:
sockaddrs: <DST,GATEWAY,IFP,IFA>
 87.250.250.242 10.2.2.2 ue0:0.e0.4c.69.1f.99 10.10.10.10
```

I do not see STICKY in flags, weight is always just 0. 

And after dozen route add/change/del tries just goes to reboot with panic.

Does it work at all? How to set up it correctly?

Thank You.


----------



## Prolixium (Sep 19, 2021)

I have a similar problem but I'm using FRR and with IPv6.  It successfully installs the routes in the kernel but only one is ever used for traffic (the one listed in route get).


```
(dax:20:23:EDT)% show ipv6 route 2620:6:2003:105::/64 
Routing entry for 2620:6:2003:105::/64
  Known via "bgp", distance 20, metric 0, best
  Last update 08:24:34 ago
    2620:6:2000:104::35 (recursive), weight 1
  *   2620:6:2000:1ff::10c2, via tun9, weight 1
  *   2620:6:2000:1ff::1172, via tun12, weight 1


(dax:20:23:EDT)% netstat -rn|grep 2620:6:2003:105::/64
2620:6:2003:105::/64              2620:6:2000:1ff::1172         UG1       tun12
2620:6:2003:105::/64              2620:6:2000:1ff::10c2         UG1        tun9
(dax:20:23:EDT)% route -n6 get 2620:6:2003:105::     
   route to: 2620:6:2003:105::
destination: 2620:6:2003:105::
       mask: ffff:ffff:ffff:ffff::
    gateway: 2620:6:2000:1ff::1172
        fib: 0
  interface: tun12
      flags: <UP,GATEWAY,DONE,PROTO1>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1455         0         0
(dax:20:23:EDT)%
```

The only sysctl that's available seems to just globally disable/enable it.  There's no options I can see for hash key/type, etc.

- Mark


----------



## SirDice (Sep 19, 2021)

varda said:


> I'm on vanilla13-STABLE





varda said:


> ```
> # uname -a
> FreeBSD server.localnetwork 13.0-STABLE FreeBSD 13.0-STABLE #0: Wed Jul 7 01:15:25 +05 2021 me@server.local/usr/obj/usr/src-13/amd64.amd64/sys/GENERIC amd64
> ```


That's a fairly old 13-STABLE. I suggest you update it.


----------



## Prolixium (Sep 20, 2021)

FWIW, I'm using something quite a bit newer and still not seeing any actual multipathing (as mentioned in my earlier reply, which is similar to OP's problem):


```
FreeBSD dax.prolixium.com 13.0-STABLE FreeBSD 13.0-STABLE #0 stable/13-n247299-aac5428f48e: Wed Sep 15 22:44:48 EDT 2021     prox@dax.prolixium.com:/usr/obj/usr/src/amd64.amd64/sys/DAX  amd64
```


----------

