Bug 202038 - [request] source address based routing without pf or ipfw
Summary: [request] source address based routing without pf or ipfw
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.1-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-02 07:38 UTC by n+freebsd
Modified: 2024-11-09 15:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description n+freebsd 2015-08-02 07:38:36 UTC
It is currently not possible to do source address based routing without firewalls such as pf or ipfw. I think that in typical multihoming scenarios (i.e. mobile devices) it doesn't make sense to have a static firewall configuration file or have some daemon dynamically mess with my firewall rules. I suggest making it possible to configure one routing table per address instead of only one per interface with ifconfig. This probably would make automatic multihoming configuration with RA or DHCPv6 easy to implement. Linux solves this problem the same way.
For Multipath TCP, proper multihoming support will become necessary.
Comment 1 Damjan Jovanovic 2024-11-09 15:37:43 UTC
Doesn't support for multiple FIBs give you a way to route by source? For example:

# Increase the number of routing tables (FIBs) to 2:
# sysctl net.fibs=2
# setfib 1 route add 192.168.0.0 -interface wlan0
# setfib 1 route add default 192.168.0.1

Then, for an "application" to use FIB 1 instead of the default 0, just:
# setfib 1 application

Or to get another source IP address to use FIB 1, make firewall rule to send it there, eg.:
# ipfw add allow all from ... to any setfib 1

Is that what you need?