![]()
startup-config /path_to_config_file
配置TenGigabitEthernet4/0/0的ip地址和端口状态
set interface state TenGigabitEthernet4/0/0 up
set interface ip address TenGigabitEthernet4/0/0 2001:1a::1/64
# 配置默认路由
ip route add ::/0 via 2001:1a::2
# 配置GigabitEthernetb/0/0的ip地址和端口状态
set interface state GigabitEthernetb/0/0 up
set interface ip address GigabitEthernetb/0/0 10.0.0.1/24
# 配置TenGigabitEthernet13/0/0的ip地址和端口状态
set interface state TenGigabitEthernet13/0/0 up
set interface ip address TenGigabitEthernet13/0/0 10.1.0.1/24
# 新建Loopback端口,配置loopback地址和端口状态
loopback create-interface
set interface ip address loop0 fc00:1::1/64
set interface state loop0 up
unix {
nodaemon
log /var/log/vpp/vpp.log
full-coredump
cli-listen /run/vpp/cli.sock
gid vpp
startup-config /etc/vpp/interface.txt
}
root@gobgp:~# vi /etc/vpp/interface.txt
set interface state GigabitEthernet7/0/0 up
set interface ip address GigabitEthernet7/0/0 192.168.123.3/24
root@gobgp:~# systemctl restart vpp
root@gobgp:~# vppctl show interface addr
GigabitEthernet7/0/0 (up):
L3 192.168.123.3/24
local0 (dn):
root@gobgp:~# cat /etc/vpp/interface.txt
set interface state GigabitEthernet7/0/0 up
set interface ip address GigabitEthernet7/0/0 192.168.123.3/24
root@gobgp:~#
root@gobgp:~# ping 192.168.123.2
connect: Network is unreachable
root@gobgp:~# vppctl
_______ _ _ _____ ___
__/ __/ _ \ (_)__ | | / / _ \/ _ \
_/ _// // / / / _ \ | |/ / ___/ ___/
/_/ /____(_)_/\___/ |___/_/ /_/
vpp# ping 192.168.123.2
116 bytes from 192.168.123.2: icmp_seq=2 ttl=64 time=.1428 ms
116 bytes from 192.168.123.2: icmp_seq=3 ttl=64 time=.0896 ms
116 bytes from 192.168.123.2: icmp_seq=4 ttl=64 time=.0839 ms
116 bytes from 192.168.123.2: icmp_seq=5 ttl=64 time=.0847 ms
root@gobgp:~#
vpp# sr policy add bsid cafe::1 next A1:: next B1:: next C1:: encap
vpp#
vpp# show sr policies
SR policies:
[0].- BSID: cafe::1
Behavior: Encapsulation
Type: Default
FIB table: 0
Segment Lists:
[0].- < a1::, b1::, c1:: > weight: 1
-----------
vpp#