Created
November 24, 2017 13:57
-
-
Save perbu/dac51ae342063058571c25801c213c1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iface eth0 dhcp | |
eth0.index: 0 | |
Iface k1 { | |
address: 10.0.1.1, | |
netmask: 255.255.255.0, | |
index: 2, | |
prerouting: [ fw, mydnat ] | |
} | |
Iface k2 { | |
address: 10.0.2.1, | |
netmask: 255.255.255.0, | |
index: 1, | |
prerouting: [ deny ], | |
postrouting: [ mysnat ] | |
} | |
Gateway gw { | |
r1: { | |
net: 10.0.1.0, | |
netmask: 255.255.255.0, | |
iface: k1 | |
}, | |
r2: { | |
net: 10.0.2.0, | |
netmask: 255.255.255.0, | |
iface: k2 | |
} | |
} | |
TARGET: 10.0.2.10 | |
TPORT: 5001 | |
Filter::IP deny { | |
if (ct.state == established) { | |
accept | |
} | |
drop | |
} | |
Filter::IP fw { | |
if (ct.state == established) { | |
accept | |
} | |
Filter::TCP { | |
if (ip.daddr == k1.address and tcp.dport == TPORT) { | |
accept | |
} | |
} // end TCP | |
drop | |
} // End of fw | |
Nat::IP mydnat { | |
Nat::TCP { | |
if (ip.daddr == k1.address and tcp.dport == TPORT ) { | |
dnat(TARGET) | |
} | |
} | |
} | |
Nat::IP mysnat { | |
Nat::TCP { | |
if (ip.daddr == TARGET and tcp.dport == TPORT ) { | |
snat(k2.address) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment