开启掘金成长之旅!这是我参与「掘金日新计划 · 2 月更文挑战」的第 16 天,点击查看活动详情
SFC 实验验证
首先删除原有链
openstack sfc port chain delete SFC-Chain01
openstack sfc flow classifier delete SFC01
创建链路与分类器
openstack sfc flow classifier create --source-ip-prefix 10.0.2.0/24 --destination-ip-prefix 10.0.5.0/24 --logical-source-port ps0 --logical-destination-port ps7 SFC2
openstack sfc port chain create --chain-parameters symmetric=true --flow-classifier SFC2 --port-pair-group PPG1 --port-pair-group PPG2 --port-pair-group PPG3 SFC-Chain01
- ovs-ofctl dump-flows br-int
cookie=0xa5608bafc63e789d, duration=4464.159s, table=0, n_packets=85, n_bytes=8330, priority=30,ip,in_port="tap7a1c016c-c0",nw_src=10.0.2.0/24,nw_dst=10.0.5.0/24 actions=group:1
cookie=0xa5608bafc63e789d, duration=4463.648s, table=0, n_packets=850, n_bytes=83300, priority=30,ip,in_port="tap9bc21911-f2",nw_src=10.0.2.0/24,nw_dst=10.0.5.0/24 actions=group:3
cookie=0xa5608bafc63e789d, duration=4463.368s, table=0, n_packets=382, n_bytes=37436, priority=30,ip,in_port="tap43002f21-0b",nw_src=10.0.5.0/24,nw_dst=10.0.2.0/24 actions=group:7003
cookie=0xa5608bafc63e789d, duration=4462.959s, table=0, n_packets=382, n_bytes=37436, priority=30,ip,in_port="tapc39752ff-86",nw_src=10.0.5.0/24,nw_dst=10.0.2.0/24 actions=group:7001
重新创建虚机,net_test5,,与SFC-SRC处于同一网段,只有一张网卡。
- VNC登录到虚机,配置路由
ip route add 10.0.5.107/32 via 10.0.2.105 dev eth0
-
从该主机ping SFC-DSET的地址转发到10.0.2.105 通过eth0网卡,该网卡属于10.0.2.0/24网段。
-
修改VM1的OVS配置,从eth2口转发到eth1口的,修改MAC目的地址为10.0.2.102(net_test5)的MAC地址
ovs-ofctl del-flows br-sfc
ovs-ofctl add-flow br-sfc "in_port=1 actions=output:2"
# 最后一跳的的mac地址修改为目标主机[src]
ovs-ofctl add-flow br-sfc "in_port=2 actions=mod_dl_dst:fa:16:3e:9f:ac:16,output:1"
ovs-ofctl add-flow br-sfc "priority=0 actions=NORMAL"a
fa:16:3e:9f:ac:16 为net_test5的mac地址
- ping测试,从net_test5能ping通SFC-DEST,并且能发现是用过10.0.2.105(SFC-SRC)转发的,因此可以验证,SFC配置中的入端口可以指定为SF的接口,中间无需VRouter等中间路由设备转发。