[ovs-discuss] ovn-nbctl does not support logical router
Russell Bryant
russell at ovn.org
Thu Jan 28 16:58:03 UTC 2016
On 01/28/2016 03:59 AM, Na Zhu wrote:
> Hi,
>
> Since OVN already supports logical router, i think should also add
> logical router support to command ovn-nbctl.
Do you have specific command suggestions? We've discussed adding
logical routers to the "show" command. I think that makes sense, but it
hasn't been done yet.
For creating/modifying them, you can actually do it using the generic db
command support that is now included.
Here is an example test script that I use with ovs-sandbox. It creates
2 logical switches with 1 port on each switch. It then connects the two
logical switches together with a logical router.
ovn-nbctl lswitch-add sw0
ovn-nbctl lport-add sw0 sw0-port1
ovn-nbctl lport-set-addresses sw0-port1 "50:54:00:00:00:01 192.168.0.2"
ovn-nbctl lswitch-add sw1
ovn-nbctl lport-add sw1 sw1-port1
ovn-nbctl lport-set-addresses sw1-port1 "50:54:00:00:00:03 11.0.0.2"
ovn-nbctl create Logical_Router name=lr0
lrp_uuid=`ovn-nbctl \
-- --id=@lrp create Logical_Router_port name=lrp0 \
network=192.168.0.1/24 mac='"00:00:00:00:ff:01"' \
-- add Logical_Router lr0 ports @lrp \
-- lport-add sw0 lrp0-attachment`
ovn-nbctl set Logical_port lrp0-attachment type=router \
options:router-port=$lrp_uuid \
addresses='"00:00:00:00:ff:01"'
lrp_uuid=`ovn-nbctl \
-- --id=@lrp create Logical_Router_port name=lrp1 \
network=11.0.0.1/24 mac='"00:00:00:00:ff:02"' \
-- add Logical_Router lr0 ports @lrp \
-- lport-add sw1 lrp1-attachment`
ovn-nbctl set Logical_port lrp1-attachment type=router \
options:router-port=$lrp_uuid \
addresses='"00:00:00:00:ff:02"'
ovs-vsctl add-port br-int lport1 -- set Interface lport1
external_ids:iface-id=sw0-port1
ovn-sbctl chassis-add fakechassis geneve 127.0.0.1
ovn-sbctl lport-bind sw1-port1 fakechassis
--
Russell Bryant
More information about the discuss
mailing list