lokkit 는 commnd line 용 iptable 설정 유틸리티이다. /etc/sysconfig/iptables 을 에디터로 수정하지 않고 손쉽게 방화벽 정책을 수정할 수 있게 해준다.

 

설치

lokkit 명령어는 system-config-firewall-base  패키지에 포함되어 있다.

yum install system-config-firewall-base
CODE

 

사용

lokkit 명령어 뒤에 옵션을 주어서 실행하면 된다. 일반적인 프로그램처럼 -v, --verbose옵션이 있으므로 자세한 정보가 필요할 경우 -v 옵션을 추가하면 된다.

--nostart

lokkit 설정시 -n 나 --nostart  옵션을 주면 설정 파일만 변경하고 iptables 를 재시작하지는 않는다.

 

--update

--update 옵션을 주면 iptables 를 재시작해 변경을 반영한다.

Service 목록 보기

 --list-services 옵션으로 처리할 수 있는 서비스 목록을 볼 수 있다.

> lokkit --list-services 
Predefined Services with Default Environment:
ipp-client: Network Printing Client (IPP)
    default: desktop
ipp: Network Printing Server (IPP)
mdns: Multicast DNS (mDNS)
    default: desktop
ipsec: IPsec
    default: desktop
ssh: SSH
    default: server
http: WWW (HTTP)
CODE

 

Service 열기

-s 옵션뒤에 서비스명을 적어주면 서비스를 열수 있다. 다음은 ssh 와 http/https 를 여는 예제이다. 

lokkit -s ssh -s http -s https
service iptables restart
CODE

 

ICMP type 목록 보기

ICMP 의 type 의 목록을 출력한다.

# lokkit --list-icmp-types                     

Supported icmp types:
echo-request: Echo Request (ping)
echo-reply: Echo Reply (pong)
destination-unreachable: Destination Unreachable
parameter-problem: Parameter Problem
redirect: Redirect
router-advertisement: Router Advertisement
router-solicitation: Router Solicitation
source-quench: Source Quench
time-exceeded: Time Exceeded
CODE

 

ICMP 차단

--block-icmp=<icmp type> 으로 ICMP 를 차단할 수 있다. <icmp type> 은 --list-icmp-types 에 표시되는 이름(Ex: echo-request등)을 적어주면 된다. 

기본 설정은 모든 ICMP 를 허용하게 되어 있다. 다음은 ping ICMP 를 막는 예제이다.

lokkit --update --block-icmp=echo-request
CODE