Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 914546c

Browse files
author
Jay Logue
authored
Merge pull request #391 from openweave/issue/fix-simnet-ip-rules
Fixed bug in simnet when installing iptables rules in the host namespace
2 parents 92ea5a2 + e436bdb commit 914546c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tools/simnet/simnet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,7 +1877,7 @@ def initSimnetIPTables(nsName=None):
18771877
# Create the simnet IPv4 FORWARD chain and add it to the default FORWARD chain.
18781878
runCmd([ 'iptables', '-N', namePrefix + 'FORWARD' ], nsName=nsName,
18791879
errMsg='Unable to create simnet iptables FORWARD chain in namespace %s' % nsName)
1880-
runCmd([ 'iptables', '-A', 'FORWARD', '-j', namePrefix + 'FORWARD' ], nsName=nsName,
1880+
runCmd([ 'iptables', '-I', 'FORWARD', '-j', namePrefix + 'FORWARD' ], nsName=nsName,
18811881
errMsg='Unable to add simnet iptables FORWARD chain to default FORWARD chain in namespace %s' % nsName)
18821882

18831883
# Set the policy on the default IPv4 FORWARD chain to DROP.
@@ -1893,7 +1893,7 @@ def initSimnetIPTables(nsName=None):
18931893
# Create the simnet IPv6 FORWARD chain and add it to the default FORWARD chain.
18941894
runCmd([ 'ip6tables', '-N', namePrefix + 'FORWARD' ], nsName=nsName,
18951895
errMsg='Unable to create simnet ip6tables FORWARD chain in namespace %s' % nsName)
1896-
runCmd([ 'ip6tables', '-A', 'FORWARD', '-j', namePrefix + 'FORWARD' ], nsName=nsName,
1896+
runCmd([ 'ip6tables', '-I', 'FORWARD', '-j', namePrefix + 'FORWARD' ], nsName=nsName,
18971897
errMsg='Unable to add simnet ip6tables FORWARD chain to default FORWARD chain in namespace %s' % nsName)
18981898

18991899
# Set the policy on the default IPv6 FORWARD chains to DROP.

0 commit comments

Comments
 (0)