####################################
RedHat 7.2 (enigma)
firewall 설정입니다.
####################################
래드햇 7.2 설치하신후
[root@ns home]# ipchains -L 하시면
방화벽 설정 내용을 보실수 있습니다.
ex)
[root@ns home]# ipchains -L
Chain input (policy ACCEPT):
target prot opt source destination ports
ACCEPT udp ------ xxx.xxx.xxx.xxx anywhere domain -> 1025:65535
ACCEPT udp ------ kns.kornet.net anywhere domain -> 1025:65535
ACCEPT udp ------ ns.domain.co.kr anywhere domain -> 1025:65535
ACCEPT tcp -y---- anywhere anywhere any -> ssh
ACCEPT tcp -y---- anywhere anywhere any -> telnet
ACCEPT tcp -y---- anywhere anywhere any -> smtp
ACCEPT tcp -y---- anywhere anywhere any -> http
ACCEPT tcp -y---- anywhere anywhere any -> ftp
ACCEPT all ------ anywhere anywhere n/a
ACCEPT all ------ anywhere anywhere n/a
REJECT tcp -y---- anywhere anywhere any -> 0:1023
REJECT tcp -y---- anywhere anywhere any -> nfs
REJECT udp ------ anywhere anywhere any -> 0:1023
REJECT udp ------ anywhere anywhere any -> nfs
REJECT tcp -y---- anywhere anywhere any -> x11:6009
REJECT tcp -y---- anywhere anywhere any -> xfs
Chain forward (policy ACCEPT):
Chain output (policy ACCEPT):
저희 서버의 내용입니다.
보시는 바와 같이 ssh telnet smtp http ftp 에관한 rule이 설정되어있습니다.
먼저 위 내용에서 필요하신게 빠져있는가를 먼저 확인하시는게 좋은것 같습니다.
설정 변경은 아래 내용으로 합니다.
eth0는 어느부분인지 저도 모르겠군요.. ^^
(참고)
래드햇 설치하시고
/etc/xinetd.d 파일 모두 정상일경우
/etc/resolv.conf 파일 정상일경우
/etc/hosts 파일 정상일경우
/etc/named.conf 파일 정상일경우
/var/mamed/*.zone 파일 모두 정상이경우
/etc/httpd/conf/httpd.conf 또는 /usr/local/apache/conf/httpd.conf 모두 정상일경우
...
기타 모든 설정이 정상임에두 불구 하고 간혹 ftp, ssh, telnet, mail, dns 가 동작하지 않는
경우에 firewall 설정을 만져 주시면 될것 같습니다.
(문제점)
제경우 콘솔에서 nslookup domain.co.kr 하면
정상적으로 출력되고 ping 도 정상적으 출력되었습니다.
그런데 외부(집)에서 ping을 보내거나 nslookup을 하면 도메인을 찾지못하거나
알수 없는 host라고 출력되며 time out 이 됩니다.
(해결)
그래서 콘솔에서 firewall을 설정 해주고 reboot해주었더니 dns가 정상적으로 동작하였습니다.
확인은 nt나 win98에서 nslookup 과 ping으로 확인하시고
이상없이 출력되면 dns가 정상적으로 작동 하는것입니다.
다음은 firewall 설정 방법입니다.
아무 위치에서나 콘솔(root)에서 setup 명령을 실행하시면 다음 과 같은 창이 나타납니다.
[root@ns home]# setup
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x
x x
Authentication configuration x x Firewa
ll configuration x x Keyboard conf
iguration x x Mouse configuration
x x Network configuration
x x Printer configuration
x x System services
x x Timezone configuration x
x X configuration x
x x
x
x x xxxxxxxxxxxx xxxxxxxx x
x x Run Tool x x Quit x x
x xxxxxxxxxxxx xxxxxxxx x
x x
x
x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
tab 키를 사용하셔서 Firewall configuration 으로 이동하신후 리턴하시면 다음이
출력됩니다. xxxxxxxxxxxxxxxxxx Firewall Configuration xxxxxxxxxxxxxxxxxx
x x
x A firewall protects against unauthorized network x
x intrusions. High security blocks all incoming accesses. x
x Medium blocks access to system services (such as telnet x
x or printing), but allows other connections. No firewall x
x allows all connections and is not recommended. x
x x
x Security Level:(*) High ( ) Medium ( ) No firewall x
x
x x xxxxxx xxxxxxxxxxxxx xx
xxxxxxxx x x x OK x x Customize x
x Cancel x x x xxxxxx xxxxxxxxxxxxx
xxxxxxxxxx x x
x x
x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 초기 설치시 medium으로 설정하셔도
setup에서는 항상 high로 나타나더군요. tab key로 mydium 선택하신후 teb key로 Customize 선택 리
턴 하시면 다음 창이 출력됩니다. xxxxxxxxxxxxxxxxxxxx Firewall Configuration - Customize xxxxxxxxxxxxxxxxxx
xxx x
x x You can customize your firewall in tw
o ways. First, you can select to x x allow all traffic from certain netwo
rk interfaces. Second, you can allow x x certain protocols explicitly through
the firewall. Specify additional x x ports in the form 'service:protocol
', such as 'imap:tcp'. x x
x
x Trusted Devices: [ ] eth0 [ ] eth0.OLD x
x
x x Allow incoming: [ ] DHCP [ ] SSH [
] Telnet x x [ ] WWW (HTTP) [
] Mail (SMTP) [ ] FTP x x
Other ports _________________________ x x
x
x xxxxxx
x x x OK x
x x
xxxxxx x
x x
x
x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx eth0 , ssh , telnet(선택입니다) , www , mail ,ftp 를 선택하신후 tab으
로 이동하셔서 OK 클릭하시면 기본 방화벽 설정이 완료 됩니다. Ok 하시면 위의 창으로 가
서 medium으 세팅된창이 나올것입니다. 그럼 다시 OK 하시고 다시 처음 창에서 Run Tool 부분
이 OK 로 변경되어 출력될것입니다. 그럼 다시 OK 선택하시고 리턴하시면 창이 종료되면서
모든 firewall 설정이 종료됩니다. firewall 설정 종료후
[root@ns home]# reboot 하시면 rule이 적용될것입니다..
리부팅하신후
[root@ns home]# ipchains -L 명령으로 rule을 한번더 확인하시면 좋을것 같습니다.
그럼 즐거운 하루 되시길 바랍니다.
위내용은 http://linux.sarang.net 의 질/답란과 1원짜리 팁란을 참고하여 작성하였습니다.
제 경우처럼 dns말고 ftp나 ssh, sendmail 에서도 같은 증상일경우
위 내용처럼 해보시길 바랍니다.--anti cracking.. -.-;