Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip implicit default route for IPv4 autoconf #923

Closed
jovatn opened this issue Jan 31, 2025 · 2 comments · Fixed by #957
Closed

Skip implicit default route for IPv4 autoconf #923

jovatn opened this issue Jan 31, 2025 · 2 comments · Fixed by #957
Assignees
Labels
Milestone

Comments

@jovatn
Copy link
Contributor

jovatn commented Jan 31, 2025

This issue started out as a proposal to make the "implicit default route for IPv4 autoconf" to be configurable, but CCB decided to remove this implicit route completely. Motivation: It can be added by explicitly by those who want it.
The description below describes the original idea.

Description

It would be good to be able to disable the implicit default route which Infix currently sets up on interfaces with IPv4 autoconfiguration.
Perhaps by an additional no default-route setting in the autoconf context

admin@infix-00-00-00:/config/interface/e1/ipv4/autoconf/> help
  enabled                           Use a ZeroConf/IPv4LL agent to retrieve an 169.254/16 address.
  request-address                   Try to acquire the specified IP address, if available.
admin@infix-00-00-00:/config/interface/e1/ipv4/autoconf/> 

Motivation

When configuring IPv4 autoconfiguration (169.254.x.x/16, also known as zeroconf) for an interface, Infix implicitly adds a default route through that interface. This default route has lowest possible routing PREFerence (254), so any default route learnt elsewhere will override.

The purpose of this default route is to facilitate easy setup with autoconf, even on links where there are units with only routeable addresses. See man page of avahi-autoipd for the following motivation/example of added default route

To allow communication between hosts that have only an IPv4LL address assigned and hosts that only
have a routable IP address assigned you may add the following routes to both network configurations:

route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99

route add default dev eth0 metric 99

Although this implicit default route seems like a good default, it would be good if it can be disabled. In OSPF, you can make a router inject a default route into OSPF, either always or only when the router itself has an active default route.
The latter is done by set default-route-advertise enabled in OSPF context, and is good to use to avoid routing to a dead end.
This OSPF use case would be incompatible with use of IPv4 autoconfiguration on the same router, unless we can disable the implicit default route.

Additional Information

A suitable test case would be

  • to let router A inject default route into OSPF, while having some interface with IPv4 autoconfig enabled
  • to let router B see if it gets a default route via OSPF from router A

Without disabling the implicit default route, B would get a default route from A via OSPF.
If A disables the implicit default route, it will no longer advertise it and B would not get a default route.

General Information

Anyone can help out by sponsoring development of new features or contributing pull requests.
Please use this issue for discussions related to the feature.

@jovatn jovatn added enhancement New feature or request feature triage Pending investigation & classification (CCB) labels Jan 31, 2025
@troglobit
Copy link
Contributor

Alternative, hard-coded solution, for Infix -- route maps!

route-map filter-defaults deny 10
  match distance 254
  match ip address prefix-list def-route
!
route-map filter-defaults permit 20
  match ip address prefix-list def-route
!
ip prefix-list def-route permit 0.0.0.0/0

I have not tried it, but with this we could deny all routes that have distance==254 from being redistributed.

@troglobit
Copy link
Contributor

CCB: decsion, drop default route entirely! No need for "automatic" or clever handling, user can set this up manually, if needed.

@troglobit troglobit added cn:styx and removed triage Pending investigation & classification (CCB) enhancement New feature or request feature labels Feb 7, 2025
@troglobit troglobit moved this to Todo in Infix & C:o Feb 7, 2025
@troglobit troglobit added this to the Infix v25.02 milestone Feb 7, 2025
@jovatn jovatn changed the title Let implicit default route for IPv4 autoconf be configurable Skip implicit default route for IPv4 autoconf Feb 10, 2025
@jovatn jovatn modified the milestones: Infix v25.02, FUTURE Feb 17, 2025
@troglobit troglobit self-assigned this Feb 23, 2025
@troglobit troglobit moved this from Todo to In progress in Infix & C:o Feb 23, 2025
@troglobit troglobit modified the milestones: FUTURE, Infix v25.02 Feb 23, 2025
troglobit added a commit that referenced this issue Feb 23, 2025
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit troglobit mentioned this issue Feb 23, 2025
17 tasks
@github-project-automation github-project-automation bot moved this from In progress to Done in Infix & C:o Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants