linux ubuntu mpls
10.10.18.148节点
focal# show run Building configuration... Current configuration: ! frr version 7.2.1 frr defaults traditional hostname focal log syslog informational no ip forwarding no ipv6 forwarding service integrated-vtysh-config ! router bgp 65000 no bgp default ipv4-unicast neighbor 10.10.18.152 remote-as 65000 neighbor 10.10.18.152 update-source ens3 ! address-family ipv4 vpn neighbor 10.10.18.152 activate exit-address-family ! router ospf ospf router-id 10.10.18.148 redistribute connected redistribute static network 10.10.18.0/24 area 0 ! mpls ldp router-id 10.10.18.148 ! address-family ipv4 discovery transport-address 10.10.18.148 ! interface eth0 ! exit-address-family ! ! line vty ! end focal#
root@focal2-2:~# vtysh Hello, this is FRRouting (version 7.2.1). Copyright 1996-2005 Kunihiro Ishiguro, et al. focal2-2# show run Building configuration... Current configuration: ! frr version 7.2.1 frr defaults traditional hostname focal2-2 log syslog informational no ip forwarding no ipv6 forwarding service integrated-vtysh-config ! router bgp 65000 no bgp default ipv4-unicast neighbor 10.10.18.148 remote-as 65000 neighbor 10.10.18.148 update-source ens3 ! address-family ipv4 vpn neighbor 10.10.18.148 activate exit-address-family ! router ospf ospf router-id 10.10.18.152 redistribute connected redistribute static network 10.10.18.0/24 area 0 ! mpls ldp router-id 10.10.18.152 ! address-family ipv4 discovery transport-address 10.10.18.152 ! interface eth0 ! exit-address-family ! ! line vty ! end focal2-2#
10.10.18.152节点
root@focal2-2:~# vtysh Hello, this is FRRouting (version 7.2.1). Copyright 1996-2005 Kunihiro Ishiguro, et al. focal2-2# show run Building configuration... Current configuration: ! frr version 7.2.1 frr defaults traditional hostname focal2-2 log syslog informational no ip forwarding no ipv6 forwarding service integrated-vtysh-config ! router bgp 65000 no bgp default ipv4-unicast neighbor 10.10.18.148 remote-as 65000 neighbor 10.10.18.148 update-source ens3 ! address-family ipv4 vpn neighbor 10.10.18.148 activate exit-address-family ! router ospf ospf router-id 10.10.18.152 redistribute connected redistribute static network 10.10.18.0/24 area 0 ! mpls ldp router-id 10.10.18.152 ! address-family ipv4 discovery transport-address 10.10.18.152 ! interface eth0 ! exit-address-family ! ! line vty ! end focal2-2#
focal# show mpls ldp neighbor AF ID State Remote Address Uptime focal# show ip ospf border-routers interface mpls-te route vrf database json neighbor router-info vrfs focal# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL focal#
focal# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL focal# show ip bgp sum IPv4 VPN Summary: BGP router identifier 10.10.18.148, local AS number 65000 vrf-id 0 BGP table version 0 RIB entries 0, using 0 bytes of memory Peers 1, using 20 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.10.18.152 4 65000 24 24 0 0 0 00:21:17 0 Total number of neighbors 1 focal#
无法建立ospf邻居
root@focal:~# tail -f /var/log/frr/ospfd.log 2020/07/24 09:24:17 OSPF: make_hello: options: 2, int: ens3:10.10.18.148 2020/07/24 09:24:17 OSPF: ospf_write to 224.0.0.5, id 25107, off 0, len 64, interface ens3, mtu 1500: 2020/07/24 09:24:17 OSPF: Hello sent to [224.0.0.5] via [ens3:10.10.18.148]. 2020/07/24 09:24:27 OSPF: make_hello: options: 2, int: ens3:10.10.18.148 2020/07/24 09:24:27 OSPF: ospf_write to 224.0.0.5, id 25108, off 0, len 64, interface ens3, mtu 1500: 2020/07/24 09:24:27 OSPF: Hello sent to [224.0.0.5] via [ens3:10.10.18.148]. 2020/07/24 09:24:37 OSPF: make_hello: options: 2, int: ens3:10.10.18.148 2020/07/24 09:24:37 OSPF: ospf_write to 224.0.0.5, id 25109, off 0, len 64, interface ens3, mtu 1500: 2020/07/24 09:24:37 OSPF: Hello sent to [224.0.0.5] via [ens3:10.10.18.148]. 2020/07/24 09:24:47 OSPF: make_hello: options: 2, int: ens3:10.10.18.148 2020/07/24 09:24:47 OSPF: ospf_write to 224.0.0.5, id 25110, off 0, len 64, interface ens3, mtu 1500: 2020/07/24 09:24:47 OSPF: Hello sent to [224.0.0.5] via [ens3:10.10.18.148]. 2020/07/24 09:24:57 OSPF: make_hello: options: 2, int: ens3:10.10.18.148 2020/07/24 09:24:57 OSPF: ospf_write to 224.0.0.5, id 25111, off 0, len 64, interface ens3, mtu 1500: 2020/07/24 09:24:57 OSPF: Hello sent to [224.0.0.5] via [ens3:10.10.18.148]. 2020/07/24 09:25:07 OSPF: make_hello: options: 2, int: ens3:10.10.18.148 2020/07/24 09:25:07 OSPF: ospf_write to 224.0.0.5, id 25112, off 0, len 64, interface ens3, mtu 1500: 2020/07/24 09:25:07 OSPF: Hello sent to [224.0.0.5] via [ens3:10.10.18.148]. ^C root@focal:~# ping 224.0.0.5 PING 224.0.0.5 (224.0.0.5) 56(84) bytes of data. ^C --- 224.0.0.5 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1020ms root@focal:~# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether fa:16:3e:07:4f:e6 brd ff:ff:ff:ff:ff:ff inet 10.10.18.148/24 brd 10.10.18.255 scope global ens3 valid_lft forever preferred_lft forever inet 10.10.18.148 peer 10.10.18.152/32 scope global ens3 valid_lft forever preferred_lft forever inet6 fe80::f816:3eff:fe07:4fe6/64 scope link valid_lft forever preferred_lft forever root@focal:~# telnet localhost 2604 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Vty password is not set. Connection closed by foreign host. root@focal:~#


还是没有
focal> show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL
focal>
root@focal:~# telnet 10.10.18.148 zebra Trying 10.10.18.148... telnet: Unable to connect to remote host: Connection refused root@focal:~# telnet localhost zebra Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Hello, this is FRRouting (version 7.2.1). Copyright 1996-2005 Kunihiro Ishiguro, et al. User Access Verification Password:
root@focal:/etc/frr# telnet 10.10.18.148 22 Trying 10.10.18.148... Connected to 10.10.18.148. Escape character is '^]'. SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1 q Invalid SSH identification string. Connection closed by foreign host. root@focal:/etc/frr#
root@focal2-2:~# telnet 10.10.18.148 zebra Trying 10.10.18.148... telnet: Unable to connect to remote host: Connection refused root@focal2-2:~#
root@focal2-2:~# telnet 10.10.18.148 zebra Trying 10.10.18.148... telnet: Unable to connect to remote host: Connection refused root@focal2-2:~# sysctl -a | grep forward net.ipv4.conf.all.bc_forwarding = 0 net.ipv4.conf.all.forwarding = 0 net.ipv4.conf.all.mc_forwarding = 1 net.ipv4.conf.default.bc_forwarding = 0 net.ipv4.conf.default.forwarding = 0 net.ipv4.conf.default.mc_forwarding = 0 net.ipv4.conf.ens3.bc_forwarding = 0 net.ipv4.conf.ens3.forwarding = 0 net.ipv4.conf.ens3.mc_forwarding = 0 net.ipv4.conf.lo.bc_forwarding = 0 net.ipv4.conf.lo.forwarding = 0 net.ipv4.conf.lo.mc_forwarding = 0 net.ipv4.ip_forward = 0 net.ipv4.ip_forward_update_priority = 1 net.ipv4.ip_forward_use_pmtu = 0 net.ipv6.conf.all.forwarding = 0 net.ipv6.conf.all.mc_forwarding = 0 net.ipv6.conf.default.forwarding = 0 net.ipv6.conf.default.mc_forwarding = 0 net.ipv6.conf.ens3.forwarding = 0 net.ipv6.conf.ens3.mc_forwarding = 0 net.ipv6.conf.lo.forwarding = 0 net.ipv6.conf.lo.mc_forwarding = 0 root@focal2-2:~#
http://infroref.org/i6230vlabnet7-OSPF.htm
root@focal:/etc/frr# vtysh Hello, this is FRRouting (version 7.2.1). Copyright 1996-2005 Kunihiro Ishiguro, et al. focal# show ip ospf interface out No such interface name focal#
focal# configure terminal focal(config)# interface out focal(config-if)# ip ospf hello-interval 1 focal(config-if)# ip ospf dead-interval 6 focal(config-if)# end focal# show ip ospf interface out out is down ifindex 0, MTU 0 bytes, BW 0 Mbit <> OSPF not enabled on this interface focal#
focal# show ip ospf interface ens3 is up ifindex 2, MTU 1500 bytes, BW 4294967295 Mbit <UP,BROADCAST,RUNNING,MULTICAST> Internet Address 10.10.18.148/24, Broadcast 10.10.18.255, Area 0.0.0.1 MTU mismatch detection: enabled Router ID 10.10.18.148, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DR, Priority 1 No backup designated router on this network Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5 Hello due in 2.774s Neighbor Count is 0, Adjacent neighbor count is 0 focal#
focal# sh ip ospf interface ens3 ens3 is up ifindex 2, MTU 1500 bytes, BW 4294967295 Mbit <UP,BROADCAST,RUNNING,MULTICAST> Internet Address 10.10.18.148/24, Broadcast 10.10.18.255, Area 0.0.0.1 MTU mismatch detection: enabled Router ID 10.10.18.148, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DR, Priority 1 No backup designated router on this network Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5 Hello due in 3.114s Neighbor Count is 0, Adjacent neighbor count is 0 focal#



focal2-2(config)# int ens3 focal2-2(config-if)# ip ospf network point-to-point focal2-2(config-if)# end focal2-2# end focal2-2# wr Note: this version of vtysh never writes vtysh.conf Building Configuration... Integrated configuration saved to /etc/frr/frr.conf [OK] focal2-2# show ip ospf int ens3 ens3 is up ifindex 2, MTU 1500 bytes, BW 4294967295 Mbit <UP,BROADCAST,RUNNING,MULTICAST> Internet Address 10.10.18.152/24, Broadcast 10.10.18.255, Area 0.0.0.0 MTU mismatch detection: enabled Router ID 10.10.18.152, Network Type POINTOPOINT, Cost: 1 Transmit Delay is 1 sec, State Point-To-Point, Priority 1 No backup designated router on this network Multicast group memberships: OSPFAllRouters Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5 Hello due in 2.447s Neighbor Count is 0, Adjacent neighbor count is 0 focal2-2#

tcpdump -i ens3 proto ospf -env

focal2-2# show ip ospf database router OSPF Router with ID (10.10.18.152) Router Link States (Area 0.0.0.0) LS age: 680 Options: 0x2 : *|-|-|-|-|-|E|- LS Flags: 0x3 Flags: 0x0 LS Type: router-LSA Link State ID: 10.10.18.152 Advertising Router: 10.10.18.152 LS Seq Number: 80000005 Checksum: 0x9911 Length: 36 Number of Links: 1 Link connected to: Stub Network (Link ID) Net: 10.10.18.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metric: 1 focal2-2#
【配置问题】
1、OSPF邻居的hello及dead interval值不一致
定位方法:a、 检查双方配置
b、 通过debug ospf hello,比较收发的hello报文中的hello及dead interval值
处理方法:修改双发的hello及dead interva一致即可
2、OSPF验证配置错误
定位方法:a、 检查双方配置
b、 通过debug ospf hello,比较收发的hello报文中的认证部分
c、 查看disp ospf error中“OSPF: wrong authentication key"或者0: OSPF: wrong authentication type是否一直增长
处理方法:修改双发的认证参数即可
3.、该接口根本就没有启动OSPF
定位方法:a、 检查双方配置
b、 通过debug ospf int,查看该端口是否使能ospf
处理方法:修改双发的配置,在接口上使能ospf即可
4、OSPF网络类型是NBMA的,但你忘记在OSPF协议模式下配置邻居了
定位方法:a、 检查双方配置,如果network-type为NBMA,看是否手工配置了邻居
处理方法:修改配置,手工指定邻居即可
5、OSPF网络类型是NBMA的,你配置了邻居,但在诸如Frame relay的map语句中忘记加broadcast关键字了,导致协议报文不能到达对方
定位方法:a、 检查双方配置,如果network-type为NBMA,且使用FR作为链路层协议,确认是否添加broadcast参数
处理方法:修改配置,在fr map 中添加broadcast参数即可
6、OSPF链路两端的网络类型不一致
定位方法:a、 检查双方配置
b、接口默认的网络类型:
ospf网络类型 链路层协议
p2p PPP、loopback
NBMA fr,x25,HDLC
p2mp 无
broadcast Ethernet
处理方法:修改配置,修改双方的网络类型一致即可
7、区域号不一致
定位方法:a、 检查双方配置
b、debug ospf packet,查看双方area是否一致
处理方法:修改配置,修改双方的区域一致即可
8、链路的网络地址不一致,注意检查两边的mask
定位方法:a、 检查双方配置,ospf不会在不同网段接口之间建立邻居关系
处理方法:修改配置,修改双方的地址为同一网段即可
9、在Stub或NSSA区域,有些路由器没有配置成Stub或NSSA
定位方法:a、 检查双方配置,ospf要求所用stub或NSSA区域内的路由器都要配置成同样的area类型
处理方法:修改配置,修改Stub或NSSA区域所有的路由器具备一样的区域类型
浙公网安备 33010602011771号