vpp常用命令与基本操作
vpp的基本操作:1,up/downvpp# set int state G0 upvpp# set int state G0 down2,配置IPvpp#set int ip address G0 192.168.59.134/243,配置macvpp#set int mac address G0 00:00:00:00:00:004,查看基本信息vpp# show intv...
·
vpp的基本操作:
1,up/down
vpp# set int state G0 up
vpp# set int state G0 down
2,配置IP
vpp#set int ip address G0 192.168.59.134/24
3,配置mac
vpp#set int mac address G0 00:00:00:00:00:00
4,查看基本信息
vpp# show int
vpp#show int addr
5,配置路由
vpp#ip route add 0.0.0.0/0 via 0.0.0.0
vpp# ip table [add|del] <table-id> //创建IPv4 table表
vpp# ip6 table [add|del] <table-id> //创建IPv6 table表
vpp# show ip fib //查看路由
vpp# show ip arp //查看arp 表
6,创建桥
vpp# create bridge-domain 100 //桥100
vpp#show bridge-domain 100 detail //查看桥下信息
7,创建vlan
vpp#create sub-interfaces G1 100 //G1.100
vpp#delete sub-interface G1.100 //del
8,将vlan放桥下
vpp#set int l2 bridge G1.100 100
9,删除桥,再删除桥
vpp#set int l3 G0
vpp#create bridge-domain 100 del
10,配置路由
vpp#ip route add 0.0.0.0/0 via 端口IP
//删除路由
vpp# ip route del 0.0.0.0/0 via 端口IP
//查看路由
vpp#show ip fib
11,配置snat
vpp# nat44 add interface address G0 //将G0 作为地址池
vpp# set interface nat44 in G1 out G2 // 设置出入口
vpp# show nat44 address //查看地址池
vpp# show nat44 interfaces //查看接口
nat44 forwarding enable|disable //nat转发的启动/禁止
12,配置dnat
vpp# set interface nat44 in <intfc> out <intfc> [output-feature] [del]
vpp# nat44 add address <ip4-range-start> [- <ip4-range-end>] [tenant-vrf <vrf-id>]
vpp# nat44 add static mapping tcp|udp|icmp local <ip4-addr> [<port>] external (<ip4-addr>|<intfc>) [<port>] [vrf <table-id>] [twice-nat] [out2in-only] [del]
13,配置wireguard
vpp# wireguard create listen-port 8899 private-key 私钥内容 src 公网IP //创建加配置
vpp# show wireguard interface
vpp# show wireguard peer
//添加peer
vpp# wireguard peer add <wg_int> public-key <pub_key_other>endpoint <ip4_dst> allowed-ip <prefix>dst-port [port_dst] persistent-keepalive [keepalive_interval]
vpp# wireguard peer remove <index> //删除peer
14,配置loopback
vpp# create loopback interface mac 00:0c:29:1f:ce:07 instance 100
vpp# delete loopback interface intfc loop100
15,配置gre
vpp# create gre tunnel src 1.1.1.2/24 dst 2.2.2.3/24 instance 100 outer-fib-id 0 //创建gre100
vpp# create gre tunnel src 1.1.1.2/24 dst 2.2.2.3/24 instance 100 outer-fib-id 0 del //删除gre100
vpp# show gre tunnel
16,配置memif
vpp# create memif id 0 /run/vpp/contiv/memif1.sock
vpp# create interface memif id 0 socket-id 1 master mode ip secret vpp123
vpp# set int state memif0 up
vpp# set int ip address memif0 192.168.1.1/24
vpp# ping 192.168.1.2 //另一个vpp 的memif 设为192.168.1.2/24
vpp# delete interface memif memif1/0 //删除操作
vpp# delete memif socket id 0 //删除操作
17,查看版本
vpp# show version
18,查看启动插件
vpp# show plugin
19, 查看vpp线程
vpp# show threads
20, 创建tap口
# create tap id 10 host-if-name host //创建tap10 linux主机上的接口为host
# set int state tap10 up //up
# set int ip address tap10 192.168.100.100/24 //设IP
有时间再追加基础操作 ~ ~
更多推荐
所有评论(0)