| OVROUTE(1M) | Maintenance Commands | OVROUTE(1M) |
ovroute —
ovroute |
router create -d
overlay -m
macaddr -v
vlan -a
address/mask [-a
address/mask] [-r
route_table_id] router_id |
ovroute |
router delete -d
overlay router_id |
ovroute |
router get -d
overlay [-o
field[,...] [-p]]
[router_id...] |
ovroute |
router set-routing-table
-d overlay
-r route_table_id
router_id |
ovroute |
route-table create -d
overlay route_table_id |
ovroute |
route-table delete -d
overlay route_table_id |
ovroute |
route-table get -d
overlay route_table_id
[-o field[,...]
[-p]]
[route_table_id...] |
ovroute |
route-table set-default
-d overlay
route_table_id |
ovroute |
route-table add -d
overlay -i
route_table_id destination
target |
ovroute |
route-table del -d
overlay -i
route_table_id destination
target |
ovroute utility is used to manage routers within an
overlay(5) network. overlay(5) routers are
used to move packets within an overlay network off the virtual layer two (VL2)
network.
For example, two VL2 subnets may wish to route packets to each
other, regardless of which physical system instances using those VL2
networks reside. As long as the underlay IPs (the UL3 address ka the IP
address of the underlying interface the overlay instance sits on, e.g. the
IP address of ‘sdc_underlay0’) of the
source and destination systems are reachable to each other, and the virtual
layer three (VL3) → virtual layer two (VL2) mappings for the source
and destination VL3 IPs, the ovroute command can be
run to setup routing between these two subnets. Normally, these entries are
managed automatically — e.g. by the Triton
‘net-agent’ process, and should
normally not need to be altered by an operator.
To route packets between VL2 subnets, an overlay(5) router instance is created for each VL2 network where packets are intended to be routed. A overlay(5) router instance should be created on any physical machine where the corresponding VL2 subnet is in use.
For example, if a subnet with a vlan id of
‘2112’ and an address range of
‘192.168.1.0/24’ on overlay
‘sdc_underlay42’ exists, then any
machine that houses an instance with an IP address within
‘192.168.1.0/24’ should have an
overlay router instance for the
‘192.168.1.0/24’ subnet created on it.
The address/mask and macaddr
parameters should be the same for all such systems. It is also recommended,
but not required, that the router id used also match. It is not necessary to
create an overlay(5) router instance on a machine if the
corresponding subnet is not in use (no instances have IP assigned to the
subnet) on that machine.
Additionally, an overlay(5) route table must be associated with each overlay(5) router instance before any routing will occur. Multiple router instances in a given overlay(5) instance can share the same route table. Both the source and destination systems must be configured with overlay(5) router instances for any VL2 networks that wish to route packets between each other. Failure to do so will result in dropped packets.
Once the router instances and router tables have been created, any
packets sent to the VL3 router IP by the instance (using the instance's
routing table), will then have the destination VL3 IP matched in the
overlay(5) routing table for the router instance that
received the packet. The match is a longest prefix match, similar to how
route(7P) works for traditional IP forwarding. If the
target address is the “any”
(‘0.0.0.0’ or
‘::0’) address, the packets are routed
to the destination subnet and the destionation machine. If another address
in the overlay(5) routing table is the longest prefix
match for the VL3 destination IP, the corresponding target IP:port value is
the underlay IP address where the encapsulated packet is sent. This is
normally used for features such as EIP, NAT or ELB. If there is no matching
destination, the packet is dropped.
ovroute router create
-d overlay
-m macaddr
-v vlan
-a address/mask
[-a address/mask]
[-r -route_table_id]
router_idCreate an overlay(5) router instance on the
overlay device overlay with an id of
router_id. The router_id
must be a unique identifer across all the overlay(5)
router instances for the given overlay(5) instance.
Valid id values consists of characters from the set [A-Za-z0-9.-]. The
MAC address for the router instance is specified by
macaddr and the vlan id of the network for the
router is given by vlan. The IP address and subnet
mask the router instance listens on is given by
address/mask. If the subnet has both an IPv4 and
IPv6 address, an additional -a
address/mask option may be specified, but at most
only 1 IPv4 and 1 IPv6 address may be given (and at least 1 address must
be specified).
Optionally, if an overlay(5) routing table
has already been defined, the -r
route_table_id option can be specified to
associate the the VL2 subnet to the given overlay(5)
route table. If no route table is specified, the default route table for
the overlay(5) device (if set) will be used.
ovroute router delete
-d overlay
router_idovroute router get
-d overlay
[-o field[,...]
[-p]] [router_id...]-o option is specified, the output is limited to
the comma separated list of fields given by the
field arguments(s):
ovroute router create
command.192.168.1.0/24’.Additionally, the -p option may be
passed with the -o option to indicate the output
should be in a machine parsable (colon delimited) format. The
-p option requires specifying the
-o option to indicate the fields to output.
ovroute router
set-routing-table -d
overlay -r
route_table_id router_idovroute route-table create
-d overlay
-r route_table_id
router_idovroute route-table delete
-d overlay
route_table_idovroute route-table get
-d overlay
[-o field[,...]
[-p]] [route_table_id...]-o option is specified, a comma separated list of
fields must be specified to indicate the fields to display. The
field values may be any combination of:
ovroute route-table
create command.Additionally, the -p option may be
given with the -o option to generate output in
machine parsable (colon delimited) format.
ovroute route-table
set-default -d overlay
route_table_idovroute route-table add
-d overlay
-i route_table_id
destination targetovroute route-table del
-d overlay
-i route_table_id
destination targetsdc_underlay1234’.90:01:02:03:04:05’.192.168.1.0/24’.10.1.2.0/24’ or
‘2001::1/96’.IP addr:port’. For IPv6 addresses,
to disambiguate the address from the port, the address must be in the form
of ‘[IPv6 addr]:port’. The IPv4
address can optionally be given in this form as well, but it is not
required. An “any” (e.g.
‘0.0.0.0/0’ or
‘::0/0’) address (with no port)
indicates the encapsulated packet should be routed and delivered to the
machine that contains the VL3 destination address of the packet.ovroute utility exits 0 on success,
and >0 if an error occurs.
In this setup, we have the following hosts, all using an
overlay instance
‘sdc_overlay7224243’ with a vnet
ID of ‘7224243’:
| HOST | VLAN | SUBNET |
| hostA | 42 | 192.168.1.0/24 |
| hostB | 2112 | 192.168.2.0/24 |
| hostC | 42 | 192.168.1.0/24 |
| 2112 | 192.168.2.0/24 |
The router instances will be as follows:
| SUBNET | ROUTER IP | ROUTER MAC |
| 192.168.1.0/24 | 192.168.1.1 | 90:b8:d0:17:f7:be |
| 192.168.2.0/24 | 192.168.2.2 | 90:b8:d0:7f:36:ac |
To enable all three vnics to route traffic between the two subnets, the appropriate router instances must be created on each host. Additionally, a routing table must be created to indicate that the traffic sent to the router IP should be routed to the other subnets.
The following commands are run on the respective hosts to enable this:
hostA# ovroute router create -d sdc_overlay7224243 -m 90:b8:d0:17:f7:be -v 42 -a 192.168.1.1/24 router-42
hostA# ovroute route-table create -d sdc_overlay7224243 rtab-default
hostA# ovroute route-table set-default -d sdc_overlay7224243 rtab-default
hostA# ovroute route-table add -d sdc_overlay7224243 -i rtab-default 0.0.0.0/0 0.0.0.0
hostB# ovroute router create -d sdc_overlay7224243 -m 90:b8:d0:7f:36:ac -v 2112 -a 192.168.2.1/24 router-2112
hostB# ovroute route-table create -d sdc_overlay7224243 rtab-default
hostB# ovroute route-table set-default -d sdc_overlay7224243 rtab-default
hostB# ovroute route-table add -d sdc_overlay7224243 -i rtab-default 0.0.0.0/0 0.0.0.0
hostC# ovroute router create -d sdc_overlay7224243 -m 90:b8:d0:17:f7:be -v 42 -a 192.168.1.1/24 router-42
hostC# ovroute router create -d sdc_overlay7224243 -m 90:b8:d0:7f:36:ac -v 2112 -a 192.168.2.1/24 router-2112
hostC# ovroute route-table create -d sdc_overlay7224243 rtab-default
hostC# ovroute route-table set-default -d sdc_overlay7224243 rtab-default
hostC# ovroute route-table add -d sdc_overlay7224243 -i rtab-default 0.0.0.0/0 0.0.0.0
Note that ‘192.168.0.0/16
0.0.0.0’ or similar could also have been used in the
routing table to route the traffic. As long as the destination network
and mask match the traffic.
This is intented to be an internal Triton utility, and it's command line interface may change without notice.
| October 26, 2020 | illumos |