-
Notifications
You must be signed in to change notification settings - Fork 325
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
Local node routing table separation #1568
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ local site = require 'gluon.site' | |
local sysconfig = require 'gluon.sysconfig' | ||
local util = require 'gluon.util' | ||
local uci = require('simple-uci').cursor() | ||
local next_node = site.next_node({}) | ||
|
||
|
||
uci:section('network', 'interface', 'client', { | ||
|
@@ -24,13 +25,35 @@ uci:section('network', 'interface', 'client', { | |
|
||
uci:delete('network', 'client_lan') | ||
|
||
uci:section('network', 'route', 'br_client_route', { | ||
interface = 'client', | ||
target = site.prefix4(), | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I wonder if such a change will lead to incorrect source address selection in some cases. I'm not sure if source address selection for hosts with multiple addresses is as well-specified for IPv4 as it is for IPv6 (at least, I don't know the relevant RFCs), but I'm thinking about the following: When the Gluon node wants to contact a local client, it will now select this route at first (before source address selection), with interface client - which doesn't have any IPv4 address. Now, how is the source address selected now? What tells Linux to use the address of local-node and not, for example, the br-wan address? The issue might be solved by adding a "source" attribute with the next-node address to this route definition, but I haven't fully thought this through yet. For IPv6, a similar issue cannot occur, as br-client should always have an address, which would be selected (at least when gluon-radvd is included, which is the default now). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also wonder if this route could lead to packets with the local-node source IPv4 address leaving through br-client, with the br-client MAC address, or if packets would go through another round of routing after choosing the source address, and then end up in routing table 2. If the former is the case, I don't think we should merge the IPv4 part of these changes... Would adding a source address attribute with the local-node IPv4 address to this route be a problem for alt-esc? |
||
|
||
uci:section('network', 'rule', 'local_node_rule', { | ||
src = next_node.ip4 .. '/32', | ||
lookup = 2, | ||
}) | ||
uci:set('network', 'local_node_rule', 'in', 'loopback') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please merge this set into the section above (same for I assume this was not done because {
...
['in'] = 'loopback',
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... and is the |
||
|
||
uci:delete('network', 'local_node_route') | ||
uci:section('network', 'route', 'local_node_route', { | ||
interface = 'local_node', | ||
target = site.prefix4(), | ||
table = 2, | ||
}) | ||
|
||
uci:section('network', 'rule6', 'local_node_rule6', { | ||
src = next_node.ip6 .. '/128', | ||
lookup = 2, | ||
}) | ||
uci:set('network', 'local_node_rule6', 'in', 'loopback') | ||
|
||
uci:delete('network', 'local_node_route6') | ||
uci:section('network', 'route6', 'local_node_route6', { | ||
interface = 'client', | ||
interface = 'local_node', | ||
target = site.prefix6(), | ||
gateway = '::', | ||
table = 2, | ||
}) | ||
|
||
uci:save('network') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@christf Please test this change with the babeld setup.