FRRouting / frr

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

NHRP "tunnel source" seems to not work #13219

Closed EasyNetDev closed 8 months ago

EasyNetDev commented 1 year ago

Describe the bug

To Reproduce

Trying to create a gre multi-point with NHRP and looks like "tunnel source" doesn't get the IP address of interface to propagate to NHRP. If I'm setting on GRE tunnel the "local" IP, then the traffic is flowing through tunnel.

Expected behavior

Screenshots

R01 config:

# /sbin/ip link add tun100101 type gre key 42 ttl 64
# /sbin/ip link set tun100101 up
# ip -d l l tun100101
193: tun100101@NONE: <UP,LOWER_UP> mtu 1472 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/gre 0.0.0.0 brd 0.0.0.0 promiscuity 0 minmtu 0 maxmtu 0
    gre remote any local 0.0.0.0 ttl 64 ikey 0.0.0.42 okey 0.0.0.42 erspan_ver 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536

# vtysh
# show run
..
interface tun100101
 ip address 10.101.0.1/32
 ip nhrp network-id 100101
 ip nhrp redirect
 ip nhrp registration no-unique
 ip nhrp shortcut
 tunnel source internet
exit
..
interface internet
 ip address 89.X.X.0/32
 ip address 89.X.X.1/32
exit
# exit
R01# show ip nhrp
Iface    Type     Protocol                 NBMA                     Claimed NBMA             Flags  Identity
tun100101 local    10.101.0.1               -                        -                               -

R05:

# /sbin/ip link add tun100101 type gre key 42 ttl 64
# /sbin/ip link set tun100101 up
# ip -d l l tun100101
34: tun100101@NONE: <UP,LOWER_UP> mtu 1472 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/gre 0.0.0.0 brd 0.0.0.0 promiscuity 0 minmtu 0 maxmtu 0
    gre remote any local 0.0.0.0 ttl 64 ikey 0.0.0.42 okey 0.0.0.42 erspan_ver 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536
# vtysh
# show run
..
interface tun100101
 ip address 10.101.0.5/32
 ip nhrp holdtime 600
 ip nhrp map 10.101.0.1 89.X.X.1
 ip nhrp map multicast 89.X.X.1
 ip nhrp map multicast dynamic
 ip nhrp network-id 100101
 ip nhrp nhs dynamic nbma 89.X.X.1
 ip nhrp redirect
 ip nhrp registration no-unique
 ip nhrp shortcut
 no link-detect
 tunnel source rds0
exit
# sh interface rds0
Interface rds0 is up, line protocol is up
  Link ups:       1    last: 2023/04/05 17:04:27.01
  Link downs:     0    last: (never)
  vrf: default
  index 23 metric 0 mtu 1492 speed 0
  flags: <UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>
  Type: PPP
  inet 86.X.X.12/32 peer 10.0.0.1/32 unnumbered
  inet6 fe80::567a:b40c/128 peer fe80::1/128
  Interface Type Other
  Interface Slave Type None
  protodown: off
# show ip nhrp
Iface    Type     Protocol                 NBMA                     Claimed NBMA             Flags  Identity
tun100101 local    10.101.0.5               -                        -                               -

Interface rds0 is acctually a PPPoE interface.

But as soon I'm adding the IP addresses for GRE interfaces only for local:

R01:

# ip link change tun100101 type gre local 89.X.X.1

R05:

# ip link change tun100101 type gre local 86.X.X.12

It starts to work perfectly:

R01# show ip nhrp
Iface    Type     Protocol                 NBMA                     Claimed NBMA             Flags  Identity
tun100101 local    10.101.0.1               89.X.X.1               89.X.X.1                      -
tun100101 dynamic  10.101.0.5               86.X.X.12            86.X.X.12             T

R05# show ip nhrp
Iface    Type     Protocol                 NBMA                     Claimed NBMA             Flags  Identity
tun100101 nhs      10.101.0.1               89.X.X.1               89.X.X.1                T
tun100101 local    10.101.0.5               86.X.X.12            86.X.X.12                   -

R05# ping 10.101.0.1
PING 10.101.0.1 (10.101.0.1) 56(84) bytes of data.
64 bytes from 10.101.0.1: icmp_seq=5 ttl=64 time=11.9 ms
64 bytes from 10.101.0.1: icmp_seq=6 ttl=64 time=11.7 ms
64 bytes from 10.101.0.1: icmp_seq=7 ttl=64 time=10.4 ms
64 bytes from 10.101.0.1: icmp_seq=8 ttl=64 time=11.5 ms
64 bytes from 10.101.0.1: icmp_seq=9 ttl=64 time=11.2 ms
64 bytes from 10.101.0.1: icmp_seq=10 ttl=64 time=11.0 ms
64 bytes from 10.101.0.1: icmp_seq=11 ttl=64 time=9.97 ms

Even I'm doing "no tunnel source" on each interface the traffic keeps flowing if "local" address is added for each GRE tunnel.

I'm missing something?

Versions

Additional context

Jafaral commented 1 year ago

@EasyNetDev , as an example, did you look at the test here: https://github.com/FRRouting/frr/tree/master/tests/topotests/nhrp_topo ?

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this issue closed.

frrbot[bot] commented 8 months ago

This issue will be automatically closed in the specified period unless there is further activity.