Add netd masquerade mode

This commit is contained in:
Mygod
2019-02-01 21:06:22 +08:00
parent 1dd8a9dcb6
commit f1973116ca
9 changed files with 84 additions and 37 deletions

View File

@@ -23,10 +23,10 @@ class LocalOnlyInterfaceManager(val downstream: String) {
routing = try {
Routing(downstream, owner).apply {
try {
ipForward() // local only interfaces need to enable ip_forward
ipForward() // local only interfaces need to enable ip_forward
forward()
if (app.masquerade) masquerade()
commit()
masquerade(Routing.masquerade)
commit(true)
} catch (e: Exception) {
revert()
throw e