Skip to content

Instantly share code, notes, and snippets.

@tormath1
Created November 5, 2021 10:15
Show Gist options
  • Save tormath1/1184ffb73bc393c6413d94bd1317b486 to your computer and use it in GitHub Desktop.
Save tormath1/1184ffb73bc393c6413d94bd1317b486 to your computer and use it in GitHub Desktop.
iptables restore
# ct --in-file ./config.yml --pretty > ./ignition.json
storage:
files:
- path: /var/lib/iptables/rules-save
filesystem: root
mode: 0644
contents:
inline: |
*filter
-A INPUT -p tcp --dport ssh -j ACCEPT
COMMIT
systemd:
units:
- name: iptables-restore.service
enabled: true
{
"ignition": {
"config": {},
"security": {
"tls": {}
},
"timeouts": {},
"version": "2.3.0"
},
"networkd": {},
"passwd": {},
"storage": {
"files": [
{
"filesystem": "root",
"path": "/var/lib/iptables/rules-save",
"contents": {
"source": "data:,*filter%0A-A%20INPUT%20-p%20tcp%20--dport%20ssh%20-j%20ACCEPT%0ACOMMIT%0A",
"verification": {}
},
"mode": 420
}
]
},
"systemd": {
"units": [
{
"enabled": true,
"name": "iptables-restore.service"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment