Skip to content

Commit

Permalink
XRay Linux firewall rules
Browse files Browse the repository at this point in the history
  • Loading branch information
outspace committed Dec 30, 2024
1 parent c0ea38d commit e0abd3f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/platforms/linux/daemon/linuxfirewall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ QStringList LinuxFirewall::getDNSRules(const QStringList& servers)
result << QStringLiteral("-o amn0+ -d %1 -p tcp --dport 53 -j ACCEPT").arg(server);
result << QStringLiteral("-o tun0+ -d %1 -p udp --dport 53 -j ACCEPT").arg(server);
result << QStringLiteral("-o tun0+ -d %1 -p tcp --dport 53 -j ACCEPT").arg(server);
result << QStringLiteral("-o tun2+ -d %1 -p udp --dport 53 -j ACCEPT").arg(server);
result << QStringLiteral("-o tun2+ -d %1 -p tcp --dport 53 -j ACCEPT").arg(server);
}
return result;
}
Expand Down Expand Up @@ -277,6 +279,7 @@ void LinuxFirewall::install()
installAnchor(Both, QStringLiteral("200.allowVPN"), {
QStringLiteral("-o amn0+ -j ACCEPT"),
QStringLiteral("-o tun0+ -j ACCEPT"),
QStringLiteral("-o tun2+ -j ACCEPT"),
});

installAnchor(IPv4, QStringLiteral("120.blockNets"), {});
Expand Down

0 comments on commit e0abd3f

Please sign in to comment.