1.拓扑
2.各路由器配置
sysname R1
ospf 1
area 0.0.0.0
network 10.0.12.0 0.0.0.255
network 10.0.13.0 0.0.0.255
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf 1 area 0.0.0.0
interface GigabitEthernet0/0
ip address 10.0.12.1 255.255.255.0
interface GigabitEthernet0/1
ip address 10.0.13.1 255.255.255.0
ip route-static 2.2.2.2 32 10.0.13.3 preference 9
sysname R2
ospf 1
area 0.0.0.0
network 10.0.12.2 0.0.0.0
network 10.0.24.2 0.0.0.0
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
ospf 1 area 0.0.0.0
interface GigabitEthernet0/0
ip address 10.0.12.2 255.255.255.0
interface GigabitEthernet0/1
ip address 10.0.24.2 255.255.255.0
sysname R3
ospf 1
area 0.0.0.0
network 10.0.13.3 0.0.0.0
network 172.17.21.0 0.0.0.255
interface GigabitEthernet0/0
ip address 10.0.13.3 255.255.255.0
interface GigabitEthernet0/1
ip address 172.17.21.5 255.255.255.0
ip route-static 2.2.2.2 32 172.17.21.28 preference 9
sysname R4
ospf 1
area 0.0.0.0
network 10.0.24.4 0.0.0.0
network 172.17.20.4 0.0.0.0
interface GigabitEthernet0/0
ip address 172.17.20.4 255.255.255.0
interface GigabitEthernet0/1
ip address 10.0.24.4 255.255.255.0
3.服务器配置与测试
#服务器物理网卡
[root@yt-hz-kvm01 ~]# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.0025909be920 yes eth2
#添加2个IP网段
ip add a 172.17.20.28/26 dev br0
ip add a 172.17.21.28/24 dev br0
#添加ospf配置文件
[root@yt-hz-kvm01 ~]# cat /etc/quagga/ospfd.conf
router ospf
ospf router-id 172.17.21.28
network 172.17.20.0/24 area 0.0.0.0
network 172.17.21.0/24 area 0.0.0.0
#启动ospf进程
systemctl restart ospfd
#查看ospf邻居与路由
查看ospf邻居
查看ospf路由
查看路由
#添加延时100ms
[root@yt-hz-kvm01 ~]# tc qdisc add dev eth2 root netem delay 100ms
#R1和r3上面增加2.2.2.2的静态路由,优先级要比ospf学到的高
#R1
ip route-static 2.2.2.2 32 10.0.13.3 preference 9
#R3
ip route-static 2.2.2.2 32 172.17.21.28 preference 9
#测试(在r2路由器上面指定环回口测试,此时由于来回路径不一致,回去的流量是经过了服务器端口)
#删除延时100ms
tc qdisc del dev eth2 root netem delay 100ms
标签:H3C,10.0,ip,ping,255.255,延时,0.0,2.2,ospf
From: https://www.cnblogs.com/uutow/p/18236905