-
Notifications
You must be signed in to change notification settings - Fork 35
VRF
OPX currently uses the Linux kernel’s network namespace to create VRFs. As a result of this approach, isolation extends beyond Layer 3 (L3). Using namespace also isolates interfaces to a particular namespace — separate processes may need to be created for monitoring services so they monitor their own individual namespace.
There are two ways to setup VRFs in OPX. The recommended way is to use the opx_config_vrf
command, but there is also a way to do it via CPS commands.
root@OPX:~# opx-config-vrf --create --vrf blue
Configuration Successful...
root@OPX:~# opx-config-vrf --show
Key: 1.292.44.2883617.2883612.2883613.
ni/network-instances/network-instance/name = blue
Key: 1.292.44.2883617.2883612.2883613.
ni/network-instances/network-instance/name = default
root@OPX:~# opx-config-vrf --create --vrf red
Configuration Successful...
root@OPX:~# opx-config-vrf --show
Key: 1.292.44.2883617.2883612.2883613.
ni/network-instances/network-instance/name = red
Key: 1.292.44.2883617.2883612.2883613.
ni/network-instances/network-instance/name = blue
Key: 1.292.44.2883617.2883612.2883613.
ni/network-instances/network-instance/name = default
These example show how to setup VRF using CPS commands.
root@OPX:~# cps_set_oid.py -oper create ni/if/interfaces/interface ni/if/interfaces/interface/bind-ni-name="blue"
root@OPX:~#
root@OPX:~# cps_set_oid.py -oper create ni/if/interfaces/interface ni/if/interfaces/interface/bind-ni-name="management" if/interfaces/interface/name="e101-002-0"
Success
Key: 1.292.44.2883617.2883612.2883613.
vrf-mgmt/ni/if/interfaces/interface/ifname = e101-002-0
vrf-mgmt/ni/if/interfaces/interface/mac-addr = 00:0c:29:df:84:a5
if/interfaces/interface/name = e101-002-0
vrf-mgmt/ni/if/interfaces/interface/ifindex = 14
cps/object-group/return-code = 0
ni/if/interfaces/interface/bind-ni-name = management
root@OPX:~# cps_set_oid.py -oper create base-ip/ipv4/address base-ip/ipv4/vrf-name="management" base-ip/ipv4/name="e101-001-0" base-ip/ipv4/address/prefix-length=16 base-ip/ipv4/address/ip=0a0b4618
root@OPX:~# cps_get_oid.py -qua target ni/network-instances ni/network-instances/network-instance/name="management"
============ni/network-instances==========
ni/network-instances/network-instance/name = management
root@OPX:~# cps_get_oid.py -qua target ni/network-instances
============ni/network-instances==========
ni/network-instances/network-instance/name = management
------------------------------------------------
ni/network-instances/network-instance/name = blue
------------------------------------------------
ni/network-instances/network-instance/name = default
------------------------------------------------
You can use Linux tools to view VRF information since they are just network namespaces. Do not use Linux tools to manipulate the VRF — use the VRF configuration script.
root@OPX:~# ip netns list
blue (id: 1)
default
management (id: 1024)
vportnetns
© 2019 OpenSwitch project. All information is contributed to and made available by OPX under the Creative Commons Attribution 4.0 International License (available at http://creativecommons.org/licenses/by/4.0/).
- Home
- System overview
- Software releases
- Hardware support
- FAQs
- Install
- Build
- Configure
- Develop
- Administer
- Troubleshoot
- Software compatibility
- Contribute
- DevOps
- Join