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

fix: ip rule is not added when only binding to wan #399

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions control/control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,15 @@ func NewControlPlane(
}
}()

/// Bind to links. Binding should be advance of dialerGroups to avoid un-routable old connection.
// Bind to LAN
if len(global.LanInterface) > 0 {
if len(global.LanInterface) > 0 || len(global.WanInterface) > 0 {
if err = core.setupRoutingPolicy(); err != nil {
return nil, err
}
}

/// Bind to links. Binding should be advance of dialerGroups to avoid un-routable old connection.
// Bind to LAN
if len(global.LanInterface) > 0 {
if global.AutoConfigKernelParameter {
_ = SetIpv4forward("1")
}
Expand Down
2 changes: 1 addition & 1 deletion docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ group {

# See https://github.com/daeuniverse/dae/blob/main/docs/en/configuration/routing.md for full examples.
routing {
pname(NetworkManager) -> direct
pname(NetworkManager, systemd-resolved, dnsmasq) -> must_direct
dip(224.0.0.0/3, 'ff00::/8') -> direct

### Write your rules below.
Expand Down
3 changes: 3 additions & 0 deletions example.dae
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ routing {
# WAN.
pname(NetworkManager) -> direct

# Bypass DNS stubs. We want to bypass their DNS requests, thus use 'must'.
pname(systemd-resolved, dnsmasq) -> must_direct

# Put it in the front to prevent broadcast, multicast and other packets that should be sent to the LAN from being
# forwarded by the proxy.
# "dip" means destination IP.
Expand Down