-
Notifications
You must be signed in to change notification settings - Fork 67
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
The implicit blacklist is insufficient. #223
Comments
- Stop translating broacast. - Apply implicit blacklist to both the EAMT and pool6. Fixes issue #223. Also includes a cgcc review.
Just an observation here: I've seen folks that are working with IPTables and DNAT add secondary IP addresses to local interfaces on the DNAT boxes in order to attract traffic to those addreses without requiring routes to be added on the upstream router, i.e., something like:
This would be roughly equivalent to:
If you implicitly blacklist all local IPv4 addresses, then it might be that this use case no longer works. To be perfectly honest, though, I don't know if it works right now either, since I'm not using such a config myself. That said, it might be possible to accomplish the same thing without assigning 192.0.2.3/32 to a local interface, e.g., using |
Just tested both the broadcast issue and the EAMT blacklist and everything works well now. Great job! |
Good catch! It's interesting to note that you used the word "secondary". It also seems reasonable to expect all such addresses to be /32. Perhaps it would be cleaner if only primary addresses were blacklisted. Or we could make exceptions out of /32s. I'm interested to see if NAT44 also handles these addresses differently; I'll take a look at the iptables code. (Also reminder to myself: If /32s end up being supposed to be translated anyway, be careful not to blacklist the "broadcast".) |
Thanks! |
Never mind. Your own example clearly shows that DNAT couldn't care less whether the So the solution of iptables is unsuitable here. By the way:
(http://linux-ip.net/html/nat-stateless.html. I guess they got tired of adding /32 addresses?) My current tendency is to let the SIIT translate host addresses that belong to /32s. These are (AFAIK) generally more specific and useless than secondary address and so they would more likely be intended for translation. Though it still feels like an ugly hack. I suppose enclosing Jool is a namespace (or the device driver model) would be cleaner; the node would consume its own packets first, Jool would translate second. But that's also a lot of documentation excess. I'll roll the code tomorrow. |
The implicit blacklist prevents SIIT Jool from translating its own node's addresses. This commits makes addresses that belong to /32 "networks" an exception. This is because some people prefer to add these addresses to attract to-be-translated traffic, as opposed to add explicit routes in all neighbors.
Update: During the testing phase of the 4.1.1 release, I ran into a slight problem with relevant code that made me rethink the solution to this issue.
I can't recall why I went with the /32 check. There's an easy means to tell whether an address is secondary or not. Before Jool 4.1.1, this used to be implemented like this:
I now think that's rather dumb. Starting from 4.1.1, it will be implemented like this:
|
Update: Because of #342, I changed the algorithm to
Why? We have 1 person requesting the /32 exception, and none requesting the secondary address exception. (Tore's was hypothetical.) The secondary address exception can be added back in the future if somebody wants it. |
This applies to both Jool 3.4 and the upcoming 3.5, though the code was already fixed in 3.5's test branch.
As stated in --blacklist, SIIT Jool has an additional implicit blacklist that prevents translation of certain IPv4 addresses regardless of the EAMT and pool6.
Rather bafflingly, that list does not currently include recognizable directed broadcast. If pool6 has 64:ff9b::/96 and Jool is connected to 192.0.2.0/24, 192.0.2.255 is happily translated into 64:ff9b::192.0.2.255 and vice versa.
Also, much like the explicit blacklist, the implicit blacklist does not currently apply to the EAMT. Among other (predictable) consequences of this, it's causing the translator itself to lose contact with IPv4 if its IPv4 address is included in the EAMT. For example, if the EAMT contains EAM [0.0.0.0/0, 2001:db8::/96] and the SIIT machine has address 192.0.2.24, then an incoming packet towards 192.0.2.24 will be translated into 2001:db8::192.0.2.24 and likely end up dropped.
Thanks to Eduardo Montoya for reporting this.
The text was updated successfully, but these errors were encountered: