FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.27k stars 1.24k forks source link

Host routes should be into the rib table like cisco, juniper or huawei commercial routers #8496

Closed lihongguang closed 6 months ago

lihongguang commented 3 years ago

There should be host routes in the rib table,or the conflicting route as shown below can’t be solved.

(lo: 1.1.1.1/32) -[R1]-(eth0: 172.24.177.146/24)------------(eth0: 172.24.177.148/24)-[R2]-(eth1: 1.1.1.1/24)

**R1:**
(1)telnet localhost 2604
ospfd# show running-config 

Current configuration:
!
frr version 3.1-dev
frr defaults datacenter
!
hostname ospfd
password zebra
log stdout
log syslog
!
!
!
!
router ospf
 ospf router-id 2.2.2.1
 network 1.1.1.1/32 area 0.0.0.0
 network 172.24.177.0/24 area 0.0.0.0
!
line vty
!
end

(2)telnet localhost 2601
R1# show ip route 
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel,
       > - selected route, * - FIB route

O>* 1.1.1.1/32 [110/0] is directly connected, lo, 00:22:26
O   172.24.177.0/24 [110/100] is directly connected, eth0, 00:37:35
C>* 172.24.177.0/24 is directly connected, eth0, 00:52:43

R1# show interface 
Interface eth0 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  PTM status: disabled
  vrf: Default-IP-Routing-Table
  index 2 metric 0 mtu 1500 speed 1000 
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 00:50:56:82:6a:17
  inet 172.24.177.146/24 broadcast 172.24.177.255
  inet6 fe80::250:56ff:fe82:6a17/64
  Interface Type Other

Interface lo is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  PTM status: disabled
  vrf: Default-IP-Routing-Table
  index 1 metric 0 mtu 65536 speed 0 
  flags: <UP,LOOPBACK,RUNNING>
  Type: Loopback
  inet 1.1.1.1/0
  Interface Type Other

**R2:**
(1)telnet localhost 2604
ospfd# show running-config 

Current configuration:
!
frr version 3.1-dev
frr defaults datacenter
!
hostname ospfd
password zebra
log stdout
log syslog
!
!
!
!
router ospf
 ospf router-id 2.2.2.2
 network 172.24.177.0/24 area 0.0.0.0
!
line vty
!
end

(2)telnet localhost 2601
R2# show ip route 

Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel,
       > - selected route, * - FIB route

C>* 1.1.1.0/24 is directly connected, eth1, 00:26:45
O>* 1.1.1.1/32 [110/100] via 172.24.177.146, eth0, 00:15:38
O   172.24.177.0/24 [110/100] is directly connected, eth0, 00:35:13
C>* 172.24.177.0/24 is directly connected, eth0, 00:45:46

(3)ip route list
1.1.1.0/24 dev eth1  proto kernel  scope link  src 1.1.1.1 
1.1.1.1 via 172.24.177.146 dev eth0  proto 188  metric 20 
172.24.177.0/24 dev eth0  proto kernel  scope link  src 172.24.177.148  metric 100

(4)ifconfig eth1
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 1.1.1.1  netmask 255.255.255.0  broadcast 1.1.1.255
        inet6 fe80::250:56ff:fe82:3b1e  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:82:3b:1e  txqueuelen 1000  (Ethernet)
        RX packets 125099  bytes 8804001 (8.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 55  bytes 7544 (7.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Question: With ospf setups above, R2 will learn the route: 1.1.1.1/32 via 172.24.177.146, although it has the host route 1.1.1.1/32, but it doesn't seem to be checked.

Note: I mean that if R2 has the host route “1.1.1.1/32”,why does zebra install “1.1.1.1/32 via 172.24.177.146 from ospf”?

[root@R2 ~]# ip route list table 0|grep 1.1.1.1
1.1.1.0/24 dev eth1 proto kernel scope link src 1.1.1.1
**1.1.1.1 via 172.24.177.147 dev eth0 proto 188 metric 20**
broadcast 1.1.1.0 dev eth1 table local proto kernel scope link src 1.1.1.1
**local 1.1.1.1 dev eth1 table local proto kernel scope host src 1.1.1.1**
broadcast 1.1.1.255 dev eth1 table local proto kernel scope link src 1.1.1.1
taspelund commented 3 years ago

Currently FRR doesn't have the concept of a "Local" route like IOS/etc, which does pose some issues for situations like this or when leaking connected routes between VRFs.

This is something I'd like to see implemented as well.

ton31337 commented 6 months ago

Already implemented in >= 10.0.

lihongguang commented 5 months ago

Well done, guys!!!