Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

VPP常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# 创建/删除主机接口G0
create host-interface name G0
delete host-interface name G0

# 设置端口状态up/down
set int state G0 up
set int state G0 down

# 设置端口MTU值
set interface mtu 9000 eth1

# 添加/删除VLAN子接口
create sub-interfaces G1 100
delete sub-interfaces G1.100

# 添加/删除IP地址,VLAN不为1
set int ip address G0 192.168.59.134/24
set int ip address del G0 192.168.59.134/24
set int ip address G0.2 192.168.59.134/24
set int ip address del G0.2 192.168.59.134/24

# 添加/删除路由
ip route add 0.0.0.0/0 via 0.0.0.0
ip route del 0.0.0.0/0 via 0.0.0.0

# 添加/删除MAC地址
set int mac address G0 00:00:00:00:00:00
set int mac address del G0 00:00:00:00:00:00

# VPP抓包
## 接口抓包
pcap trace rx tx drop max 100000 file vpp_any.pcap max-bytes-per-pkt 1000
pcap trace rx tx drop max [number] intfc [eth] file [filename.pcap] max-bytes-per-pkt [number]
pcap trace rx tx max [number]
pcap trace rx tx status
pcap trace off
##节点抓包
pcap dispatch trace on max 100000 file vpp-dispatch-trace.pcap
pcap dispatch trace off

# 查看端口、路由、ARP表信息
show int
show int addr
show hardware-interfaces
show ip fib
show ip arp
show ip neighbor
show ip6 neighbor
show dpdk buffer
show dpdk int
show version
show plugin
show threads
show memory

# 添加/删除table表
ip table add <table-id>
ip table del <table-id>

# 添加/删除桥
create bridge-domain 100
delete bridge-domain 100

# 将VLAN放在桥下
set int l2 bridge G1.100 100

# 删除桥,再删除桥接域
set int l3 G0
create bridge-domain 100 del

# memif添加/删除
create interface memif id 0 master
create interface memif id 0 slave
set int state memif0/0 up
set int ip address host-vpp 10.0.0.2/24
delete interface memif memif0/0
delete memif socket id 0

评论