VPP/Command-line Interface (CLI) Guide
参考: https://wiki.fd.io/view/VPP/Command-line_Interface_(CLI)_Guide
1. bridge-domain
Summary/usage
create bridge-domain <bridge-domain-id> [learn <0|1>] [forward <0|1>] [uu-flood <0|1>] [flood <0|1>] [arp-term <0|1>] [mac-age <nn>] [del].
create bridge-domain 2 arp-term 1 mac-age 60
2. Layer 3 IP CLI
2.1 ip route
添加或者删除 IPv4 或者 IPv6 路由
Summary/usage
ip route [add|del] [count <n>] <dst-ip-addr>/<width> [table <table-id>] [via <next-hop-ip-addr> [<interface>] [weight <weight>]] | [via arp <interface> <adj-hop-ip-addr>] | [via drop|punt|local<id>|arp|classify <classify-idx>] [lookup in table <out-table-id>].
ip route add 100.100.100.100/32 via 100.100.100.1 eth0 添加静态路由
ip route del 100.100.100.100/32 via 100.100.100.1 eth0 删除静态路由
2.2 ping
Summary/usage
ping {<ip-addr> | ipv4 <ip4-addr> | ipv6 <ip6-addr>} [ipv4 <ip4-addr> | ipv6 <ip6-addr>] [source <interface>] [size <pktsize>] [interval <sec>] [repeat <cnt>] [table-id <id>] [verbose].
ping 192.168.122.1 source eth0 repeat 2
2.3 set interface ip
2.3.1 set interface ip address 设置接口 IP 地址
Summary/usage
set interface ip address [del] <interface> <ip-addr>/<mask> | [all].
set interface ip address eth1 100.100.100.100/24
set interface ip address del eth1 100.100.100.100/24
2.3.2 set interface ip table
Summary/usage
set interface ip table <interface> <table-id>.
show ip fib 查看路由表