Linux

iptables ICMP 허용

범고래_1 2021. 5. 12. 11:40

ping을 허용하려면 INPUT, OUTPUT 모두 허용해줘야 한다.

iptables -I INPUT -s [SOURCE_IP] -p icmp --icmp-type echo-request -j ACCEPT
iptables -I OUTPUT -d [SOURCE_IP] -p icmp --icmp-type echo-reply -j ACCEPT

나갈 때는 출발지와 목적지가 바뀌는 것에 유의한다.

 

정책 삭제 방법

정책 번호를 확인한다.

iptables -L --line-numbers

INPUT, OUPUT 확인 후 정책 번호로 삭제하면 된다.

iptables -D INPUT 1

 

정책 백업 방법

iptables restart하면 초기화된다 (...)

iptables-save ~/iptables.local

'Linux' 카테고리의 다른 글

libssl install (libcrypto)  (0) 2022.05.24
core 파일 안 뜰때  (0) 2022.01.23
Ubuntu 20.04에서 network restart  (0) 2020.10.05
VMware Fusion 리눅스 폴더 공유 안 될 때  (0) 2020.03.05
sources.list 카카오 (kakao)  (0) 2018.09.10