본문 바로가기

ETC/자격증

[리눅스마스터]제1601회 리눅스마스터 1급 2차 시험 작업식 풀이 2

반응형

14. 다음은 DNS 서버의 존(zone) 파일 설정이다. 조건에 맞게 ( 괄호 ) 안에 알맞은 내용을 적으시오.(12점)

$TTL 1D
@ IN SOA ( ① ) ( ② ) (
						2014051301 ; serial
						1D ; refresh
						1H ; retry
						1W ; expire
						3H ) ; minimum
	IN NS ( ① )
	IN A 192.168.12.22
	IN ( ③ ) ( ④ )
www IN A 192.168.12.22
www1 IN ( ⑤ ) www
www2 IN ( ⑤ ) www

<조 건>
- 네임 서버의 주소는 ns.linux.or.kr로 설정한다.
- 관리자 이메일주소는 posein@linux.or.kr로 설정한다.
- 메일 서버는 linux.or.kr로 설정한다.
- 호스트명이 www1 및 www2를 요청했을 경우에는 www로 연결되도록 설정한다.

 

[root@server1 ~]# cd /var/named/
[root@server1 named]# ll
total 16
drwxrwx---. 2 named named    6 Feb 24 02:17 data
drwxrwx---. 2 named named    6 Feb 24 02:17 dynamic
-rw-r--r--. 1 root  root     0 Mar 21 17:28 example.com.zone
-rw-r-----. 1 root  named 2253 Apr  5  2018 named.ca
-rw-r-----. 1 root  named  152 Dec 15  2009 named.empty
-rw-r-----. 1 root  named  152 Jun 21  2007 named.localhost
-rw-r-----. 1 root  named  168 Dec 15  2009 named.loopback
drwxrwx---. 2 named named    6 Feb 24 02:17 slaves

 

[root@server1 named]# vi example.com.zone
$TTL 4
@       IN SOA  ns1.example.com. root.example.com. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       127.0.0.1
        AAAA    ::1
        IN      NS      ns1
ns1     IN      A       192.168.10.200

 

$ORIGIN  {영역명}.
$TTL       {TTL 시간}
# 리소스 레코드 영역
{영역명}.       IN        SOA        {DNS 서버 주소}.       {DNS 관리자 메일주소}.    (
                                                                   {Zone 파일 개정번호 입력}
                                                                   {보조 DNS 서버 사용 시, Refresh 타임 입력}
                                                                   {보조 DNS 서버 사용 시, Retry 타임 입력}
                                                                   {보조 DNS 서버 사용 시, Zone 파일 파기 유예기간 설정}
                                                                   {네거티브 캐시 유효기간 설정}     )
{영역명}.      IN         NS           {DNS 서버 도메인 주소}
{영역명}.      IN         MX          {우선 순위 번호 입력}        {메일 서버 도메인 주소 입력}
{서버1 Host}    IN         A            {서버1 IP 주소 입력}          
{서버2 Host}    IN         A            {서버2 IP 주소 입력}

 

① ns.linux.or.kr.

② posein.linux.or.kr.

③ MX 0

④ linux.or.kr.

⑤ CNAME

 

15. 다음 TCP Wrapper를 이용하여 접근을 제한하는 과정이다.

아래의 조건에 맞게 ( 괄호 ) 안에 알맞은 내용을 적으시오.(12점)

# vi /etc/hosts.deny
ALL: ALL
# vi /etc/hosts.allow
( ① ): 192.168.6.7
( ② ): ( ③ )

<조 건>
- 텔넷서비스는 호스트의 IP 주소가 192.168.6.7만 허가한다.
- FTP 서비스는 192.168.12.0 네트워크 대역의 호스트만 허가한다.
- FTP 서버는 vsftpd를 사용한다.

 

/etc/hosts.allow : 파일에 정의된것은 허용

/etc/hosts.deny 파일에 정의된것은 거부가 되고, 만약 정의 되지 않은 내용이 있다면, 허용

 

[root@server1 named]# find / -name hosts.deny
/etc/hosts.deny

 

[root@server1 named]# vi /etc/hosts.deny
#
# hosts.deny    This file contains access rules which are used to
#               deny connections to network services that either use
#               the tcp_wrappers library or that have been
#               started through a tcp_wrappers-enabled xinetd.
#
#               The rules in this file can also be set up in
#               /etc/hosts.allow with a 'deny' option instead.
#
#               See 'man 5 hosts_options' and 'man 5 hosts_access'
#               for information on rule syntax.
#               See 'man tcpd' for information on tcp_wrappers

 

[root@server1 named]# vi /etc/hosts.allow
#
# hosts.allow   This file contains access rules which are used to
#               allow or deny connections to network services that
#               either use the tcp_wrappers library or that have been
#               started through a tcp_wrappers-enabled xinetd.
#
#               See 'man 5 hosts_options' and 'man 5 hosts_access'
#               for information on rule syntax.
#               See 'man tcpd' for information on tcp_wrappers

 

in.telnetd : DARPA 텔넷 대화형 통신 프로토콜을 지원하는 서버

 

① in.telnetd

② vsftpd

③ 192.168.12.

 

16. 다음은 현재 설정된 iptables 정책을 저장하는 과정이다. 다음 ( 괄호 ) 안에 알맞은 내용을 적으시오.(8점)

가. 관련 명령어를 사용한 정책 저장 및 반영
# ( ① ) > firewall.sh
# ( ② ) < firewall.sh

나. 관련 스크립트를 이용한 저장과 설정된 정책 확인
# service iptables ( ③ )
# cat ( ④ )

<조 건>
- ① : iptables로 설정된 정책을 파일로 저장하는 명령어를 적는다.
- ② : 파일에 저장된 iptables 정책을 불러들여서 설정하는 명령어를 적는다.
- ③ : iptables 정책을 저장하는 인자값(argument)를 적는다.
- ④ : 관련 스크립트에 의해 정책이 저장되는 파일명을 절대경로로 기재한다.

 

[root@server1 named]# find / -name iptables
/etc/sysconfig/iptables
/usr/sbin/iptables
/usr/share/bash-completion/completions/iptables
/usr/libexec/initscripts/legacy-actions/iptables
/usr/libexec/iptables

 

[root@server1 named]# vi /etc/sysconfig/iptables
# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

 

SEE ALSO
       iptables-apply(8), iptables-save(8), iptables-restore(8), iptables-extensions(8),

       The  packet-filtering-HOWTO  details iptables usage for packet filtering, the NAT-HOWTO details NAT, the
       netfilter-extensions-HOWTO details the extensions that are not in the  standard  distribution,  and  the
       netfilter-hacking-HOWTO details the netfilter internals.

 

① iptables-save

② iptables-restore

③ save

④ /etc/sysconfig/iptables

반응형