mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Native YAML - system (#3625)
* Native YAML - system * Remove comment that is not applicable to the code
This commit is contained in:
parent
737c6afb54
commit
cc25f24475
26 changed files with 514 additions and 135 deletions
|
@ -295,25 +295,49 @@ options:
|
|||
|
||||
EXAMPLES = '''
|
||||
# Block specific IP
|
||||
- iptables: chain=INPUT source=8.8.8.8 jump=DROP
|
||||
- iptables:
|
||||
chain: INPUT
|
||||
source: 8.8.8.8
|
||||
jump: DROP
|
||||
become: yes
|
||||
|
||||
# Forward port 80 to 8600
|
||||
- iptables: table=nat chain=PREROUTING in_interface=eth0 protocol=tcp match=tcp destination_port=80 jump=REDIRECT to_ports=8600 comment="Redirect web traffic to port 8600"
|
||||
- iptables:
|
||||
table: nat
|
||||
chain: PREROUTING
|
||||
in_interface: eth0
|
||||
protocol: tcp
|
||||
match: tcp
|
||||
destination_port: 80
|
||||
jump: REDIRECT
|
||||
to_ports: 8600
|
||||
comment: Redirect web traffic to port 8600
|
||||
become: yes
|
||||
|
||||
# Allow related and established connections
|
||||
- iptables: chain=INPUT ctstate=ESTABLISHED,RELATED jump=ACCEPT
|
||||
- iptables:
|
||||
chain: INPUT
|
||||
ctstate: ESTABLISHED,RELATED
|
||||
jump: ACCEPT
|
||||
become: yes
|
||||
|
||||
# Tag all outbound tcp packets with DSCP mark 8
|
||||
- iptables: chain=OUTPUT jump=DSCP table=mangle set_dscp_mark=8 protocol=tcp
|
||||
- iptables:
|
||||
chain: OUTPUT
|
||||
jump: DSCP
|
||||
table: mangle
|
||||
set_dscp_mark: 8
|
||||
protocol: tcp
|
||||
|
||||
# Tag all outbound tcp packets with DSCP DiffServ class CS1
|
||||
- iptables: chain=OUTPUT jump=DSCP table=mangle set_dscp_mark_class=CS1 protocol=tcp
|
||||
- iptables:
|
||||
chain: OUTPUT
|
||||
jump: DSCP
|
||||
table: mangle
|
||||
set_dscp_mark_class: CS1
|
||||
protocol: tcp
|
||||
'''
|
||||
|
||||
|
||||
def append_param(rule, param, flag, is_list):
|
||||
if is_list:
|
||||
for item in param:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue