Re: [PATCH] metric: Enable support for route metric on FreeBSD
Pouria Mousavizadeh Tehrani <[email protected]>
| Newsgroups | gmane.network.openvpn.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi
On 8/5/26 16:16, Gert Doering wrote:
> Hi,
>
> On Wed, Aug 05, 2026 at 02:06:33PM +0330, Pouria Mousavizadeh Tehrani wrote:
>> The route metric has been available since FreeBSD version 1600019.
>
> Is there some documentation what this does? As in, can you now install
> two routes for the same prefix, with different metrics, and the one
> with the "lowest metric wins"?
Yes, the route(8) manual is updated.
https://man.freebsd.org/cgi/man.cgi?query=route&sektion=8&manpath=freebsd-current
To answer your question:
```
% mdo route -n4 add -net 172.31.0.0/16 -gateway 192.168.1.1 -metric 10
add net 172.31.0.0: gateway 192.168.1.1
% mdo route -n4 add -net 172.31.0.0/16 -gateway 192.168.1.2 -metric 1
add net 172.31.0.0: gateway 192.168.1.2
% netstat -rn4W | grep 172.31.0.0
172.31.0.0/16 192.168.1.1 UGS 0 1500 bridge0 10
172.31.0.0/16 192.168.1.2 UGS 0 1500 bridge0 1
% route -n4 get 172.31.0.0
route to: 172.31.0.0
destination: 172.31.0.0
mask: 255.255.0.0
gateway: 192.168.1.2
...
```
>
> gert
--
Pouria
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
OpenPGP_signature.asc
(application/pgp-signature, 265 B)
-----BEGIN PGP SIGNATURE----- iJEEARYKADkWIQSqt7cppfvJ816gj0lUwVnUeMwagAUCanNFgRsUgAAAAAAEAA5t YW51MiwyLjUrMS4xMiwyLDMACgkQVMFZ1HjMGoBJFgEAsNV0cGK+gCgBS/2zW0tc TPxdKitBCMm8NPxiNeejaWMBAOwFstmuA9jd62W7ngoLFtD51NBY5u78aorFcQxd TfID =l9c+ -----END PGP SIGNATURE-----