VPP Component
#If tap interfaces in vBRG are down, run the following commands
Bring up tap interfaces in BRG
root>vppctl tap delete tap-0
root>vppctl tap delete tap-1
root>/opt/bind_nic.sh
root>/opt/set_nat.sh
root>vppctl show int
#Show dhcp client
Show DHCP client
root@zdcpe1cpe01brgemu01-201901181358:/opt# vppctl show dhcp client
[0] GigabitEthernet0/4/0 state DHCP_BOUND addr 10.3.0.2/24 gw 10.3.0.1
#Show snat detail
Show snat detail
root@zdcpe1cpe01brgemu01-201901181358:/opt# vppctl show snat detail
SNAT mode: dynamic translations enabled
tap-1 in
GigabitEthernet0/4/0 out
tap-0 in
SNAT pool addresses interfaces:
GigabitEthernet0/4/0
10.3.0.2
tenant VRF independent
0 busy udp ports
1 busy tcp ports
0 busy icmp ports
1 users, 1 outside addresses, 1 active sessions, 1 static mappings
Hash table in2out
1 active elements
1 free lists
0 linear search buckets
Hash table out2in
1 active elements
1 free lists
0 linear search buckets
Hash table worker-by-in
1 active elements
1 free lists
0 linear search buckets
Hash table worker-by-out
0 active elements
0 free lists
0 linear search buckets
Thread 0 (vpp_main at lcore 0):
2 list pool elements
192.168.4.20: 0 dynamic translations, 1 static translations
static mappings:
tcp local 192.168.4.20:8183 external 10.3.0.2:8183 vrf 0
# Show vxlan tunnel
root@zdcpe1cpe01gw01-201812032302:/opt# vppctl show vxlan tunnel
[0] src 10.5.0.104 dst 10.5.0.21 vni 104 sw_if_index 4 encap_fib_index 0 fib_entry_index 9 decap_next l2
# show vgw ip address used by vpp interface
show vgw interface ip address
root@zdcpe1cpe01gw01-201812032302:/opt# vppctl show int addr
GigabitEthernet0/4/0 (up):
10.5.0.104/24
GigabitEthernet0/6/0 (up):
10.2.0.4/24
local0 (dn):
loop0 (up):
l2 bridge bd_id 10 bvi shg 2
192.168.1.254/24
tap-0 (up):
l2 bridge bd_id 10 shg 0
vxlan_tunnel0 (up):
l2 bridge bd_id 10 shg 1
#Show brg interface ip
show brg interface ip
root@zdcpe1cpe01brgemu01-201812011854:~# vppctl show int addr
GigabitEthernet0/4/0 (up):
10.3.0.2/24
local0 (dn):
tap-0 (up):
l2 bridge bd_id 10 shg 0
tap-1 (up):
20.0.0.40/24
vxlan_tunnel0 (up):
l2 bridge bd_id 10 shg 2
#Show interface mac address
Show interface mac address
root@zdcpe1cpe01brgemu01-201812282326:~# vppctl show hardware-interfaces
Name Idx Link Hardware
GigabitEthernet0/4/0 1 up GigabitEthernet0/4/0
Ethernet address fa:16:3e:85:fa:ab
Red Hat Virtio
carrier up full duplex speed 10000 mtu 9216
rx queues 1, rx desc 256, tx queues 1, tx desc 256
tx frames ok 65
tx bytes ok 21778
rx frames ok 327
rx bytes ok 41230
extended stats:
rx good packets 327
tx good packets 65
rx good bytes 41230
tx good bytes 21778
rx q0packets 327
rx q0bytes 41230
tx q0packets 65
tx q0bytes 21778
rx q0 good packets 327
rx q0 good bytes 41230
rx q0 multicast packets 262
rx q0 broadcast packets 2
rx q0 undersize packets 1
rx q0 size 65 127 packets 269
rx q0 size 128 255 packets 1
rx q0 size 256 511 packets 56
tx q0 good packets 65
tx q0 good bytes 21778
tx q0 undersize packets 1
tx q0 size 65 127 packets 5
tx q0 size 256 511 packets 58
tx q0 size 1024 1518 packets 1
local0 0 down local0
local
tap-0 2 up tap-0
Ethernet address 02:fe:bd:f2:7b:71
tap-1 3 up tap-1
Ethernet address 02:fe:36:99:a5:5c
#show nat.service
Show nat.service
root@zdcpe1cpe01brgemu01-201901181358:/opt# systemctl status nat.service
● nat.service - Runs vbrg scripts for nat configuration
Loaded: loaded (/etc/systemd/system/nat.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2019-01-18 17:01:54 UTC; 5h 58min ago
Process: 2509 ExecStart=/opt/nat_service.sh (code=exited, status=0/SUCCESS)
Main PID: 2509 (code=exited, status=0/SUCCESS)
Jan 18 17:01:54 zdcpe1cpe01brgemu01-201901181358 systemd[1]: Started Runs vbrg scripts for nat configuration.
Jan 18 17:02:25 zdcpe1cpe01brgemu01-201901181358 nat_service.sh[2509]: hc tap ip address is 192.168.4.20
#service managed by systemd
root@zdcpe1cpe01gw01-201812032302:/opt# systemctl | grep dhcp
isc-dhcp-server.service loaded active running ISC DHCP IPv4 server
root@zdcpe1cpe01gw01-201812032302:/opt# systemctl status isc-dhcp-server.service
? isc-dhcp-server.service - ISC DHCP IPv4 server
Loaded: loaded (/etc/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2018-12-03 23:07:48 UTC; 5h 8min ago
Docs: man:dhcpd(8)
Main PID: 1477 (dhcpd)
Tasks: 1
Memory: 9.1M
CPU: 683ms
CGroup: /system.slice/isc-dhcp-server.service
??1477 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf
Dec 04 04:16:07 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: DHCPREQUEST for 192.168.1.2 from 86:65:56:0c:1b:34 via lstack
Dec 04 04:16:08 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: ns1.example.org: host unknown.
Dec 04 04:16:08 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: ns2.example.org: host unknown.
Dec 04 04:16:08 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: DHCPACK on 192.168.1.2 to 86:65:56:0c:1b:34 (zdcpe1cpe01brgemu01-201812011854) via lstack
Dec 04 04:16:26 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: reuse_lease: lease age 19 (secs) under 25% threshold, reply with unaltered, existing lease
Dec 04 04:16:26 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: DHCPREQUEST for 192.168.1.2 from 86:65:56:0c:1b:34 (zdcpe1cpe01brgemu01-201812011854) via lstack
Dec 04 04:16:26 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: DHCPACK on 192.168.1.2 to 86:65:56:0c:1b:34 via lstack
Dec 04 04:16:29 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: reuse_lease: lease age 22 (secs) under 25% threshold, reply with unaltered, existing lease
Dec 04 04:16:29 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: DHCPREQUEST for 192.168.1.2 from 86:65:56:0c:1b:34 via lstack
Dec 04 04:16:29 zdcpe1cpe01gw01-201812032302 dhcpd[1477]: DHCPACK on 192.168.1.2 to 86:65:56:0c:1b:34 via lstack