-
Notifications
You must be signed in to change notification settings - Fork 2
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
Define pref-src for AMPR routes #8
base: master
Are you sure you want to change the base?
Conversation
By defining the pref-src for AMPR routes the Mikrotik router will source requests sent via AMPR routes and tunnels from a 44net address instead of a private RFC1918 or a commercial IP address.
The problem of non 44 net source addresses has been discussed recently on the 44net mailing list under the thread "[44net] Misconfiguration of gateway tunnel interfaces". The thread contains a few examples where the source IP address in the encapsulated packet is the same as the gateway endpoint, which indicates that the packet was locally sourced. This pull requests solves this issue for Mikrotik RouterOS using this tool to generate the configuration. |
|
|
The default behavior is to use the address assigned to that interface as a source address. We define that explicitly when the ipip interface is created. The pref-src attribute exists for cases where you have multiple addresses assigned to an interface--this will never happen with the ipip interfaces. Leaking RFC1918 addresses can be solved with a firewall rule. Even with pref-src, there are many ways to leak RFC1918 addresses unless your firewall prohibits it. |
I'm confused. Where exactly does the script add 44net IP addresses to ampr-* IPIP interfaces, I cannot find any statement in the form of /ip address add interface=ampr-a.b.c.d address=44.x.y.z ..... So AFAICT there is not a single IP address assigned to the IPIP interface (beside the endpoints but those are irrelevant or part of the problem, as the OS may choose the local endpoint address as the source packet for the encapsulated packet). This patch will fix situation where the AMPR gateway is the source of the offending packets. If the AMPR Gateway is carefully designed, leaking by routing can be avoided by /ip settings set rp-filter=strict |
You're right; I guess I misspoke. Pref-src could be valuable on routers that have both 44 and not-44 addresses. Now the question is where the best place to define the source address is or whether to inspect the router to find it. The choices are:
Regardless, you will still need a firewall rule to be sure your router does not forward packets from RFC1918 addresses. Only packets generated or address-translated by the gateway router will be able to take advantage of the pref-src attribute. |
By defining the pref-src for AMPR routes the Mikrotik router will source requests sent via AMPR routes and tunnels from a 44net address instead of a private RFC1918 or a commercial IP address.