Modifying iptables

Prev Next

You can add new rules at the beginning or end of existing chains. Adding new chains is not supported.

AppGate ZTNA runs on OverlayFS, a temporary file system that reloads every time the system boots. Changes made to iptables on the running system are non-persistent. Use cz-iptables to make persistent changes.

Add a new rule at the beginning of a chain

# iptables -t filter -I INPUT -m comment --comment ciao

Show the diff with the default iptables

# cz-iptables diff

{'ip6tables': {}, 'iptables': {'filter': {'INPUT': {'insert': ['-m comment -- comment ciao']}}}}

Add a new rule to the end of a chain

# iptables -t filter -A INPUT -m comment --comment bye

Show the diff again

# cz-iptables diff

{'iptables': {'filter': {'INPUT': {'insert': ['-m comment --comment ciao'],
'append': ['-m comment --comment bye']}}}, 'ip6tables': {}}

Permanently save the changes

# cz-iptables save

Permanently destroy any custom change

# cz-iptables flush