File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ High level abstractions
141141`` python-iptables `` implements a low-level interface that tries to closely
142142match the underlying C libraries. The module `` iptc.easy `` improves the
143143usability of the library by providing a rich set of high-level functions
144- designed to simplify the interaction with the library, for example::
144+ designed to simplify the interaction with the library, for example:
145145
146146 >>> import iptc
147147 >>> iptc.easy.dump_table('nat', ipv6=False)
@@ -160,6 +160,11 @@ designed to simplify the interaction with the library, for example::
160160 [{'protocol': 'tcp', 'target': 'ACCEPT', 'tcp': {'dport': '22'}}]
161161 >>> iptc.easy.delete_chain('filter', 'TestChain', flush=True)
162162
163+ >>> # Example of goto rule // iptables -A FORWARD -p gre -g TestChainGoto
164+ >>> iptc.easy.add_chain('filter', 'TestChainGoto')
165+ >>> rule_goto_d = {'protocol': 'gre', 'target': {'goto': 'TestChainGoto'}}
166+ >>> iptc.easy.insert_rule('filter', 'FORWARD', rule_goto_d)
167+
163168Rules
164169-----
165170
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ High level abstractions
77``python-iptables `` implements a low-level interface that tries to closely
88match the underlying C libraries. The module ``iptc.easy `` improves the
99usability of the library by providing a rich set of high-level functions
10- designed to simplify the interaction with the library, for example::
10+ designed to simplify the interaction with the library, for example:
1111
1212 >>> import iptc
1313 >>> iptc.easy.dump_table(' nat' , ipv6 = False )
@@ -26,6 +26,11 @@ designed to simplify the interaction with the library, for example::
2626 [{'protocol': 'tcp', 'target': 'ACCEPT', 'tcp': {'dport': '22'}}]
2727 >>> iptc.easy.delete_chain(' filter' , ' TestChain' , flush = True )
2828
29+ >>> # Example of goto rule // iptables -A FORWARD -p gre -g TestChainGoto
30+ >>> iptc.easy.add_chain(' filter' , ' TestChainGoto' )
31+ >>> rule_goto_d = {' protocol' : ' gre' , ' target' : {' goto' : ' TestChainGoto' }}
32+ >>> iptc.easy.insert_rule(' filter' , ' FORWARD' , rule_goto_d)
33+
2934Rules
3035-----
3136
You can’t perform that action at this time.
0 commit comments