vpp vrf

默认table 0

 set interface ip table loop2 vrf1

 loop1 in vrf1 and loop2 in vrf2

nat44-out2in no translation with multiple tenants

Example Usage
Example of how to add a straight forward static route:

vpp# ip route add 6.0.1.2/32 via 6.0.0.1 GigabitEthernet2/0/0
Example of how to delete a straight forward static route:

vpp# ip route del 6.0.1.2/32 via 6.0.0.1 GigabitEthernet2/0/0
Mainly for route add/del performance testing, one can add or delete multiple routes by adding ‘count N’ to the previous item:

vpp# ip route add count 10 7.0.0.0/24 via 6.0.0.1 GigabitEthernet2/0/0
Add multiple routes for the same destination to create equal-cost multipath:

vpp# ip route add 7.0.0.1/32 via 6.0.0.1 GigabitEthernet2/0/0

vpp# ip route add 7.0.0.1/32 via 6.0.0.2 GigabitEthernet2/0/0
For unequal-cost multipath, specify the desired weights. This combination of weights results in 3/4 of the traffic following the second path, 1/4 following the first path:

vpp# ip route add 7.0.0.1/32 via 6.0.0.1 GigabitEthernet2/0/0 weight 1

vpp# ip route add 7.0.0.1/32 via 6.0.0.2 GigabitEthernet2/0/0 weight 3
To add a route to a particular FIB table (VRF), use:

vpp# ip route add 172.16.24.0/24 table 7 via GigabitEthernet2/0/0
VPP Configuration steps for a common router on top of telco router:
comment { configure wan port }
set int state port1 up
comment { set int mac address port1 7D:3F:69:54:b8:4C }
set dhcp client intfc port1 hostname vpprouter

comment { create IRB loopback interface }
loopback create
set int l2 bridge loop0 1 bvi
set int ip address loop0 192.168.2.1/24
set int state loop0 up

comment { add more ports to the IRB bridge group }
set int l2 bridge port2 1
set int state port2 up

set int l2 bridge port3 1
set int state port3 up

set int l2 bridge port4 1
set int state port4 up

set int l2 bridge port5 1
set int state port5 up

set int l2 bridge port6 1
set int state port6 up

comment { create tap iface for dhcp server and host-stack access }
create tap host-if-name lstack host-ip4-addr 192.168.2.2/24 host-ip4-gw 192.168.1.1
set int l2 bridge tap0 1
set int state tap0 up

comment { configure nat }
nat44 add interface address port1
set interface nat44 in loop0 out port1

nat44 add static mapping local 192.168.2.2 22 external port1 22 tcp

add default linux route via 192.168.2.1

 

原文地址:https://www.cnblogs.com/dream397/p/12760173.html