Next: , Previous: , Up: Platform specific information   [Contents][Index]


9.2 Routes

In some cases it might be necessary to add more routes to the virtual network interface. There are two ways to indicate which interface a packet should go to, one is to use the name of the interface itself, another way is to specify the (local) address that is assigned to that interface (local_address). The former way is unambiguous and therefore preferable, but not all platforms support this.

Adding routes to IPv4 subnets:

Linuxroute add -net network_addressnetmasknetmask interface
Linux iproute2ip route add network_address/prefixlengthdevinterface
FreeBSDroute add network_address/prefixlength local_address
OpenBSDroute add network_address/prefixlength local_address
NetBSDroute add network_address/prefixlength local_address
Solarisroute add network_address/prefixlength local_address-interface
Darwin (MacOS/X)route add network_address/prefixlength local_address
Windowsnetsh routing ip add persistentroute network_address netmask interface local_address

Adding routes to IPv6 subnets:

Linuxroute add -A inet6 network_address/prefixlength interface
Linux iproute2ip route add network_address/prefixlengthdevinterface
FreeBSDroute add -inet6 network_address/prefixlength local_address
OpenBSDroute add -inet6 network_address local_address-prefixlenprefixlength
NetBSDroute add -inet6 network_address local_address-prefixlenprefixlength
Solarisroute add -inet6 network_address/prefixlength local_address-interface
Darwin (MacOS/X)?
Windowsnetsh interface ipv6 add route network address/prefixlength interface