diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-02 23:53:48 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-02 23:53:48 +0200 |
commit | d7e39f26d711b5736a3a478b0d8b353c0c02e958 (patch) | |
tree | 8955fc93622cf8cca448cfe4425e5192452e5469 /examples/var_service/fw | |
parent | 4a36ef11ac4d46ae651cbedc440ca6853415283a (diff) | |
download | busybox-w32-d7e39f26d711b5736a3a478b0d8b353c0c02e958.tar.gz busybox-w32-d7e39f26d711b5736a3a478b0d8b353c0c02e958.tar.bz2 busybox-w32-d7e39f26d711b5736a3a478b0d8b353c0c02e958.zip |
examples/var_service/fw/run: allow extif's to be more than one iface
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples/var_service/fw')
-rwxr-xr-x | examples/var_service/fw/run | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/examples/var_service/fw/run b/examples/var_service/fw/run index 41078d0ab..15c2b2f0a 100755 --- a/examples/var_service/fw/run +++ b/examples/var_service/fw/run | |||
@@ -179,7 +179,9 @@ ipt="iptables -t nat -A OUTPUT" | |||
179 | # OUTGOING TRAFFIC | 179 | # OUTGOING TRAFFIC |
180 | ipt="iptables -t nat -A POSTROUTING" | 180 | ipt="iptables -t nat -A POSTROUTING" |
181 | # Masquerade boxes on my private net | 181 | # Masquerade boxes on my private net |
182 | doit $ipt -s 192.168.0.0/24 -o $extif -j MASQUERADE | 182 | for e in $extif; do |
183 | doit $ipt -s 192.168.0.0/24 -o $e -j MASQUERADE | ||
184 | done | ||
183 | 185 | ||
184 | # *** mangle *** | 186 | # *** mangle *** |
185 | ### DEBUG | 187 | ### DEBUG |
@@ -204,7 +206,9 @@ fi | |||
204 | doit $ipt -p tcp -j REJECT # Anything else isn't ok. REJECT = irc opens faster | 206 | doit $ipt -p tcp -j REJECT # Anything else isn't ok. REJECT = irc opens faster |
205 | # (it probes proxy ports, DROP will incur timeout delays) | 207 | # (it probes proxy ports, DROP will incur timeout delays) |
206 | ipt="iptables -t filter -A INPUT" | 208 | ipt="iptables -t filter -A INPUT" |
207 | doit $ipt -i $extif -j iext | 209 | for e in $extif; do |
210 | doit $ipt -i $e -j iext | ||
211 | done | ||
208 | 212 | ||
209 | 213 | ||
210 | echo; echo "* Enabling forwarding" | 214 | echo; echo "* Enabling forwarding" |
@@ -222,12 +226,12 @@ echo; echo "* Routing:" | |||
222 | ip r l | 226 | ip r l |
223 | echo; echo "* Firewall:" | 227 | echo; echo "* Firewall:" |
224 | { | 228 | { |
225 | echo '---FILTER--'; | 229 | echo '---FILTER--' |
226 | iptables -v -L -x -n; | 230 | iptables -v -L -x -n |
227 | echo '---NAT-----'; | 231 | echo '---NAT-----' |
228 | iptables -t nat -v -L -x -n; | 232 | iptables -t nat -v -L -x -n |
229 | echo '---MANGLE--'; | 233 | echo '---MANGLE--' |
230 | iptables -t mangle -v -L -x -n; | 234 | iptables -t mangle -v -L -x -n |
231 | } \ | 235 | } \ |
232 | | grep -v '^$' | grep -Fv 'bytes target' | 236 | | grep -v '^$' | grep -Fv 'bytes target' |
233 | echo | 237 | echo |