$cat /etc/iptables.rules
$sudo nano /etc/network/if-pre-up.d/iptables-load 입력
#!/bin/bash
/sbin/iptables-restore < /etc/iptables.rules
$sudo nano /etc/network/if-post-down.d/iptables-reload 입력
#!/bin/bash
/sbin/iptables-save > /etc/iptables.rules
$sudo chmod +x /etc/network/if-pre-up.d/iptables-load
$sudo chmod +x /etc/network/if-post-down.d/iptables-reload
$sudo reboot
기타 iptables 유용한 명령어
$sudo iptables -L 룰 보기
$sudo iptables -A 룰 추가
$sudo iptables -D FORWARD 행번호 rule 삭제
$sudo netfilter-persistent save
$sudo netfilter-persistent reload
$sudo ufw disable && sudo ufw enable 재시작
댓글 없음:
댓글 쓰기