실습목표 

EIGRP와 BGP를 활용해 이더채널처럼 운용할 계획이다.

모든 라우터에 BGP를 설정하고, R2와 R3에만 EIGRP를 사용할 것이다.

 

R1 라우터 설정

R1(config)#int e0/1
R1(config-if)#ip add 1.1.21.1 255.255.255.0
R1(config-if)#no sh

R1(config-if)#int e0/0
R1(config-if)#ip add 1.1.12.1 255.255.255.0
R1(config-if)#no sh

 

R1(config)#int lo 0
R1(config-if)#ip add 10.10.0.1 255.255.255.0
R1(config-if)#no sh

R1(config-if)#int lo 1
R1(config-if)#ip add 100.100.100.1 255.255.255.0
R1(config-if)#no sh

 

R2 라우터 설정

R2(config-if)#int e0/0
R2(config-if)#ip add 1.1.32.2 255.255.255.0
R2(config-if)#no sh

R2(config-if)#int e0/1
R2(config-if)#ip add 1.1.23.2 255.255.255.0
R2(config-if)#no sh

 

R2(config-if)#int e0/2
R2(config-if)#ip add 1.1.12.2 255.255.255.0
R2(config-if)#no sh

 

R2(config-if)#int e0/3
R2(config-if)#ip add 1.1.21.2 255.255.255.0
R2(config-if)#no sh

 

R2(config)#int lo 0
R2(config-if)#ip add 10.10.10.1 255.255.255.0
R2(config-if)#no sh

 

R3 라우터 설정

R3(config)#int e0/0
R3(config-if)#ip add 1.1.32.3 255.255.255.0
R3(config-if)#no sh

 

R3(config-if)#int e0/1
R3(config-if)#ip add 1.1.23.3 255.255.255.0
R3(config-if)#no sh

R3(config-if)#int e0/2
R3(config-if)#ip add 1.1.34.3 255.255.255.0
R3(config-if)#no sh

 

R3(config)#int lo 0
R3(config-if)#ip add 10.10.20.1 255.255.255.0
R3(config-if)#no sh

 

R4 라우터 설정
R4(config)#int e0/0
R4(config-if)#ip add 1.1.34.4 255.255.255.0
R4(config-if)#no sh

 

===============================================================

기본설정에서 경로와 LO 정보들을 만들었다.

BGP 설정을 해주겠다.

 

R1 라우터 설정

R1(config)#router bgp 100
R1(config-router)#neighbor 1.1.21.2 remote-as 300
R1(config-router)#neighbor 1.1.12.2 remote-as 300
R1(config-router)#network 10.10.0.0 mask 255.255.255.0
R1(config-router)#network 100.100.100.0 mask 255.255.255.0

 

R2 라우터 설정

R2(config-router)#router bgp 300
R2(config-router)#neighbor 1.1.21.1 remote-as 100
R2(config-router)#neighbor 1.1.12.1 remote-as 100

R2(config-router)#neighbor 1.1.23.3 remote-as 300
R2(config-router)#neighbor 1.1.32.3 remote-as 300

R2(config-router)#network 10.10.10.0 mask 255.255.255.0

 

R3 라우터 설정

R3(config)#router bgp 300
R3(config-router)#neighbor 1.1.23.2 remote-as 300
R3(config-router)#neighbor 1.1.32.2 remote-as 300
R3(config-router)#neighbor 1.1.34.4 remote-as 200
R3(config-router)#network 10.10.20.0 mask 255.255.255.0

 

R4 라우터 설정

R4(config)#router bgp 200
R4(config-router)#neighbor 1.1.34.3 remote-as 300

 

bgp 설정을 마치고 R4 라우터에서 광고받은 네트워크를 확인해 본다.

R1라우터에서의 LO 네트워크를 하나도 광고받지 못했다.

한단계씩 올라가며 어디까지 광고받았는지 확인 해보았다.

바로 앞 R3에서 R1의 LO 네트워크에 대한 광고를 받았지만,

최적의 경로가 아니고 더 이상 다음 eBGP로 광고가 되지 않는다.

Next-hop을 확인해보니 1.1.12.1로 R1 라우터의 정보가 출력되어 있다.

다음 명령어를 통해 Next-hop을 임의로 지정해주었다.

 

R2(config-router)#neighbor 1.1.12.1 next-hop-self
R2(config-router)#neighbor 1.1.21.1 next-hop-self

 

 

해당 명령어를 입력하자, 정상적으로 네트워크를 광고받아 출력되는 것을 확인할 수 있었다.

 

EIGRP 라우팅을 활용해 부하분산을 시도한다.

 

EIGRP로 라우팅을 하자 라우팅 테이블에 아래와 같은 항목이 추가 되었다.

하나의 라우터에 두가지 경로가 표시되는데, 작업을 두개 이상의 포트로 나누어 한다고 해서 부하분산 이라고 한다.

 

D        10.10.20.0/24 [90/409600] via 1.1.32.3, 00:00:31, Ethernet0/0
                              [90/409600] via 1.1.23.3, 00:00:31, Ethernet0/1

   -> 부하 분산(equal cost Load balancing, 메트릭 동일할 때 가능)

 

만약에 1.1.32.2 경로를 강제로 끊어보았더니,

네트워크가 정지하지 않고 1.1.23.2와 연결되어 통신이 된다는 것을 확인할 수 있었다.

 

실습 목표

 1. BGP 설정
  eBGP Peer -> R1<->R2, R2<->R3

 2. Static NAT 설정 -> R1에 설정함
 inside global address : 4.4.4.0/24

 3. 기본경로 설정 -> R4에 설정

 4. R1에 192.168.1.0 /24 경로 설정

 5. R1에서 ROOTBACK 0 만들고 광고하기

 

 

라우터 기본 설정 -

R1 라우터 설정

R1(config)#int e0/0
R1(config-if)#ip add 1.1.14.1 255.255.255.0
R1(config-if)#no sh

R1(config-if)#int e0/1
R1(config-if)#ip add 1.1.12.1 255.255.255.0
R1(config-if)#no sh

 

R2 라우터 설정

R2(config)#int e0/0
R2(config-if)#ip add 1.1.12.2 255.255.255.0
R2(config-if)#no sh

R2(config-if)#int e0/1
R2(config-if)#ip add 1.1.23.2 255.255.255.0
R2(config-if)#no sh

 

R3 라우터 설정

R3(config)#int e0/0
R3(config-if)#ip add 1.1.23.3 255.255.255.0
R3(config-if)#no sh

R3(config-if)#int e0/1
R3(config-if)#ip add 3.3.3.1 255.255.255.0
R3(config-if)#no sh

 

R4 라우터 설정

R4(config)#int e0/0
R4(config-if)#ip add 192.168.1.1 255.255.255.0
R4(config-if)#no sh

R4(config-if)#int e0/1
R4(config-if)#ip add 1.1.14.4 255.255.255.0
R4(config-if)#no sh

 


R1(config)#int lo 0
R1(config-if)#ip add 4.4.4.1 255.255.255.0
R1(config-if)#no sh

 

============================================================

기본설정을 마치고 BGP 설정을 해주겠다.

 

R4(config)#router bgp 100
R4(config-router)#neighbor 1.1.14.1 remote-as 100

R4(config-router)#network 192.168.1.0 mask 255.255.255.0

 

R1(config)#router bgp 100
R1(config-router)#neighbor 1.1.14.4 remote-as 100
R1(config-router)#neighbor 1.1.12.2 remote-as 200
R1(config-router)#neighbor 1.1.12.2 ebgp-multihop 3

R1(config-router)#network 4.4.4.0 mask 255.255.255.0

 

R2(config)#router bgp 200
R2(config-router)#neighbor 1.1.12.1 remote-as 100
R2(config-router)#neighbor 1.1.12.1 ebgp-multihop 4
R2(config-router)#neighbor 1.1.23.3 remote-as 300
R2(config-router)#neighbor 1.1.23.3 ebgp-multihop 2

 

R3(config)#router bgp 300
R3(config-router)#neighbor 1.1.23.2 remote-as 200
R3(config-router)#neighbor 1.1.23.2 ebgp-multihop 5

R3(config-router)#network 3.3.3.0 mask 255.255.255.0

 

각 라우터에 연결되어 있는 호스트를 광고 해 주어야 한다. 

그렇지 않으면 통신이 되지 않는다.

=====================================================

NAT 설정

R1#debug ip nat
IP NAT debugging is on

R1(config)#ip nat inside source static 192.168.1.100 4.4.4.100


R1(config)#int e0/0
R1(config-if)#ip nat inside

R1(config-if)#int e0/1
R1(config-if)#ip nat outside

 

=====================================================

마지막으로 R4에서 기본경로 설정을 해준다.

R4(config)#ip route 0.0.0.0 0.0.0.0 1.1.14.1

 

 

 

 

실습목표

R1, R2, R4, R5에만 BGP 설정을 하고, R3에는 BGP 설정을 하지 않는다.

R3에는 BGP 설정을 하지 않았기에 R1에서 Lo 0를 광고하여도 R2까지만 광고가 된다.

이를 R5로 광고가 되도록 설정해보아라.

 

R1 라우터 설정

R1(config)#int e0/0
R1(config-if)#ip add 1.1.12.1 255.255.255.0
R1(config-if)#no sh

R1(config-if)#int lo 0

R1(config-if)#ip add 172.16.1.1 255.255.255.0

 

R1(config-if)#int lo 0
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#no sh

 

R2 라우터 설정

R2(config)#int e0/0
R2(config-if)#ip add 1.1.12.2 255.255.255.0
R2(config-if)#no sh

R2(config-if)#int e0/1
R2(config-if)#ip add 1.1.23.2 255.255.255.0
R2(config-if)#no sh

 

R3 라우터 설정

R3(config)#int e0/0
R3(config-if)#ip add 1.1.23.3 255.255.255.0
R3(config-if)#no sh


R3(config-if)#int e0/1
R3(config-if)#ip add 1.1.34.3 255.255.255.0
R3(config-if)#no sh

 

R4 라우터 설정

R4(config)#int e0/0
R4(config-if)#ip add 1.1.34.4 255.255.255.0
R4(config-if)#no sh


R4(config-if)#int e0/1
R4(config-if)#ip add 1.1.45.4 255.255.255.0
R4(config-if)#no sh

 

R5 라우터 설정

R5(config)#int e0/0
R5(config-if)#ip add 1.1.45.5 255.255.255.0
R5(config-if)#no sh

 

======================================================

기본 설정을 마치고, BGP 설정을 해주겠다.

 

R1 라우터 설정

R1(config-if)#router bgp 100
R1(config-router)#neighbor 1.1.12.2 remote-as 200

R1(config-router)#network 172.16.1.0 mask 255.255.255.0

 

R2 라우터 설정

R2(config-if)#router bgp 200
R2(config-router)#neighbor 1.1.12.1 remote-as 100
R2(config-router)#neighbor 1.1.23.3 remote-as 200

 

R4 라우터 설정

R4(config-if)#router bgp 200
R4(config-router)#neighbor 1.1.34.3 remote-as 200
R4(config-router)#neighbor 1.1.45.5 remote-as 300

 

R5 라우터 설정

R5(config-if)#router bgp 300

R5(config-router)#neighbor 1.1.45.4 remote-as 200

 

BGP 설정을 마치고, R1부터 R5까지 LO 0 가 잘 광고가 되었는지 확인해보기 위해

Show ip bgp 명령어를 입력했다.

 

R2까지는 광고가 되었지만, R3라우터에 BGP를 설정하지 않아서

R4부터는 광고가 되지 않아 아무런 내용이 출력되지 않았다.

이러한 경우 정적 라우팅을 통해 R2~R4까지의 경로를 라우터에게 알려주는 방법이 있다.

 

R2(config)#ip route 1.1.34.0 255.255.255.0 1.1.23.3

 

R4(config)#ip route 1.1.23.0 255.255.255.0 1.1.34.3

R4(config)#ip route 1.1.12.0 255.255.255.0 1.1.34.3

 

정적 라우팅까지 마치자 R5에서 LO 0 가 광고되는 것을 확인할 수 있었다.

 

실습목표

스위치를 통해 연결된 라우터간에 BGP를 설정하여 네이버 설정을 하라.

R2 라우터에서 LO 0를 선언하고 광고하라

 

R1 라우터 설정

R1(config)#int e0/1
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#no sh

 

R2 라우터 설정

R2(config)#int e0/0
R2(config-if)#ip add 1.1.1.2 255.255.255.0
R2(config-if)#no sh

R2(config-if)#int lo 0
R2(config-if)#ip add 172.16.30.1 255.255.255.0
R2(config-if)#no sh

 

R3 라우터 설정

R3(config)#int e0/0
R3(config-if)#ip add 1.1.1.3 255.255.255.0
R3(config-if)#no sh

 

=========================================

기본 설정을 마치고 BGP 설정을 해준다.

 

R1 라우터 설정

R1(config)#router bgp 100
R1(config-router)#neighbor 1.1.1.3 remote-as 200

R1(config-router)#neighbor 1.1.1.2 remote-as 100

 

R2 라우터 설정

R2(config-if)#router bgp 100
R2(config-router)#neighbor 1.1.1.1 remote-as 100
R2(config-router)#neighbor 1.1.1.3 remote-as 200
R2(config-router)#network 172.16.30.0 mask 255.255.255.0

 

R3 라우터 설정

R3(config)#router bgp 200
R3(config-router)#neighbor 1.1.1.1 remote-as 100
R3(config-router)#neighbor 1.1.1.2 remote-as 100

 

     Network          Next Hop            Metric LocPrf Weight Path
 *   172.16.30.0/24   1.1.1.2                                0 100 i
 *>                   1.1.1.2                  0             0 100 i

 

R3에서 Lo 0 의 네트워크를 광고받는 것을 확인할 수 있다.

 

기본 설정

R1

 

R1(config)#int e0/0
R1(config-if)#ip add 1.1.12.1 255.255.255.0
R1(config-if)#no sh

 

R2

 

R2(config)#int e0/0
R2(config-if)#ip add 1.1.12.2 255.255.255.0
R2(config-if)#no sh

R2(config-if)#int e0/1
R2(config-if)#ip add 1.1.23.2 255.255.255.0
R2(config-if)#no sh

 

R3

 

R3(config-if)#int e0/0
R3(config-if)#ip add 1.1.23.3 255.255.255.0
R3(config-if)#no sh

R3(config-if)#int e0/1
R3(config-if)#ip add 1.1.34.3 255.255.255.0
R3(config-if)#no sh

 

R4

 

R4(config)#int e0/0
R4(config-if)#ip add 1.1.34.4 255.255.255.0
R4(config-if)#no sh


R4(config-if)#int e0/1
R4(config-if)#ip add 1.1.45.4 255.255.255.0
R4(config-if)#no sh

 

 

R5

R5(config)#int e0/0
R5(config-if)#ip add 1.1.45.5 255.255.255.0
R5(config-if)#no sh

 

=====================================================================

기본 설정을 마치고 동적 라우팅, BGP를 설정해 준다.

BGP의 기본 설정 명령어는

    Router(config)# router bgp AS_Number
    Router(config-router)# neighbor 네이버주소 remote-as 네이버AS번호

이다.

주어진 AS번호를 활용해 설정한다.

 

R1

    R1(config)#router bgp 100
    R1(config-router)#neighbor 1.1.12.2 remote-as 200
    R1(config-router)#ex


    R1(config)#int lo 0
    R1(config-if)#ip add 192.168.1.1 255.255.255.0
    R1(config-if)#no sh

 > 루프백 인터페이스를 만들어줌, 물리적으로 존재하지 않는 논리적인 인터페이스 포트이다.

 

R2

    R2(config)#router bgp 200
    R2(config-router)#neighbor 1.1.12.1 remote-as 100
    R2(config-router)#neighbor 1.1.23.3 remote-as 300

 

 R3
    R3(config)# router bgp 300
    R3(config-router)# neighbor 1.1.23.2 remote-as 200
    R3(config-router)# neighbor 1.1.34.4 remote-as 300

 R4
    R4(config)# router bgp 300
    R4(config-router)# neighbor 1.1.34.3 remote-as 300
    R4(config-router)# neighbor 1.1.45.5 remote-as 400

 R5
    R5(config)# router bgp 400
    R5(config-router)# neighbor 1.1.45.4 remote-as 300

 

 

R3의 네이버 관계를 확인해본다.

R3#show ip bgp summary

 

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.23.2        4          200       7       9        1    0    0 00:05:14        0
1.1.34.4        4          300       7       8        1    0    0 00:04:31        0

 

1.1.23.2와 AS200으로 네이버 관계를,

1.1.34.4와 AS300으로 네이버 관계를 맺고 있다는 것을 확인할 수 있다.

 

R1에서 Loopback 0 를 광고해 다른 네이버에게 Loopback에 대한 정보를 알 수 있도록 설정해보자.

 

R1(config-router)#network 192.168.1.0 mask 255.255.255.0

R3#show ip bgp
BGP table version is 2, local router ID is 1.1.23.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.1.0      1.1.23.2                               0 200 100 i

 

*>는 BGP가 인지한 최적의 경로임을 나타낸다.

해당 명령어를 통해 광고받은 네트워크의 정보와 Next hop의 정보 외에도 많은 것을 확인할 수 있다.

 

R4에서 광고받은 네트워크를 확인해보았다.

 

     Network          Next Hop            Metric LocPrf Weight Path
 * i 192.168.1.0      1.1.23.2                 0    100      0 200 100 i

 

BGP는 최적의 경로가 아니라고 설명한다.

R5에서 Show ip bgp를 해도 아무런 광고가 되지 않는다.

 

이런 경우에는 정적 라우팅 ip route를 활용해 넥스트홉을 임의로 지정해 줄 수 있다.

 

R4(config)# ip route 1.1.23.0 255.255.255.0 1.1.34.3

 

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 192.168.1.0      1.1.23.2                 0    100      0 200 100 i

 

정적 라우팅을 통해 넥스트홉을 지정하자 최적의 경로로 변경되었다.

 

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.1.0      1.1.45.4                               0 300 200 100 i

 

아무런 내용이 출력되지 않았던 R5에서도 Loopback 0의 네트워크 정보를 광고받는것을 확인할 수 있다.

실습목표

L3 스위치에서 VLAN을 생성하고, 각 호스트에 분배하라.

Static NAT를 이용해 주어진 IP주소로 변환하라.

지역간 통신이 원활하게 하라.

 

대구 라우터 설정

Daegu(config)#do debug ip nat

IP NAT debugging is on

 

Daegu(config)#ip nat inside source static 192.168.10.100 100.100.10.100

 

Daegu(config)#ip nat inside source static 192.168.20.100 100.100.20.100

 

Daegu(config)#ip nat inside source static 192.168.10.254 100.100.10.254

 

Daegu(config)#int fa0/0

Daegu(config-if)#ip nat outside

 

Daegu(config-if)#int fa0/1

Daegu(config-if)#ip nat inside

 

NAT 설정을 해준 후, 기본 설정을 해주었다.

 

부산 라우터 설정

Busan(config)#int fa0/1

Busan(config-if)#ip add 200.200.200.1 255.255.255.0

Busan(config-if)#no sh

 

Busan(config-if)#int fa0/0

Busan(config-if)#ip add 1.1.1.10 255.255.255.252

Busan(config-if)#no sh

 

Busan(config)#ip route 100.100.10.0 255.255.255.0 1.1.1.9

Busan(config)#ip route 100.100.20.0 255.255.255.0 1.1.1.9

 

대구 라우터 설정

Daegu(config)#int fa0/0

Daegu(config-if)#ip add 1.1.1.9 255.255.255.252

Daegu(config-if)#no sh

 

Daegu(config-if)#int fa0/1

Daegu(config-if)#ip add 1.1.1.6 255.255.255.252

Daegu(config-if)#no sh

 

Daegu(config)#ip route 192.168.10.0 255.255.255.0 1.1.1.5

Daegu(config)#ip route 192.168.20.0 255.255.255.0 1.1.1.5

Daegu(config)#ip route 200.200.200.0 255.255.255.0 1.1.1.10

 

FW 라우터 설정

FW(config)#int fa0/1

FW(config-if)#ip add 1.1.1.5 255.255.255.252

FW(config-if)#no sh

 

FW(config-if)#int fa0/0

FW(config-if)#ip add 1.1.1.2 255.255.255.252

FW(config-if)#no sh

 

FW(config)#ip route 192.168.10.0 255.255.255.0 1.1.1.1

FW(config)#ip route 192.168.20.0 255.255.255.0 1.1.1.1

FW(config)#ip route 200.200.200.0 255.255.255.0 1.1.1.6

 

GW L3 스위치 설정

GW(config)#int fa0/24

GW(config-if)#no switchport

GW(config-if)#ip add 1.1.1.1 255.255.255.252

GW(config-if)#no sh

GW(config-if)#exit

 

GW(config)#ip routing

 

GW(config)#vlan 10

GW(config-vlan)#vlan 20

 

GW(config-vlan)#int vlan 10

GW(config-if)#ip add 192.168.10.1 255.255.255.0

GW(config-if)#no sh

 

GW(config-if)#int vlan 20

GW(config-if)#ip add 192.168.20.1 255.255.255.0

GW(config-if)#no sh

 

GW(config-if)#int ra fa0/21-22

GW(config-if-range)#switchport access vlan 10

 

GW(config-if-range)#int fa0/23

GW(config-if)#switchport access vlan 20

 

GW(config)#ip route 200.200.200.0 255.255.255.0 1.1.1.2

 

부산 라우터만 정적 라우팅 IP주소가 NAT로 변환된 주소인 이유는, 대구 라우터에서 NAT를 설정했기 때문이다.

 

설정을 마치자 통신이 원활하게 되는 것을 확인할 수 있다.

 

 

 

 

 

실습 목표

Static NAT 설정을 통해 192.168.1.0 네트워크를 100.100.100.0 네트워크로 변환

정적 라우팅을 활용하여 라우팅

변환된 주소로 웹서버 접속

 

대구 라우터 설정

 

Daegu(config)#int fa0/1

Daegu(config-if)#ip add 192.168.1.1 255.255.255.0

Daegu(config-if)#no sh

 

Daegu(config-if)#int fa0/0

Daegu(config-if)#ip add 1.1.1.1 255.255.255.252

Daegu(config-if)#no sh

 

ISP 라우터 설정

 

ISP(config)#int fa0/1

ISP(config-if)#ip add 1.1.1.2 255.255.255.252

ISP(config-if)#no sh

 

ISP(config-if)#int fa0/0

ISP(config-if)#ip add 1.1.1.5 255.255.255.252

ISP(config-if)#no sh

 

부산 라우터 설정

 

Busan(config)#int fa0/1

Busan(config-if)#ip add 1.1.1.6 255.255.255.252

Busan(config-if)#no sh

 

Busan(config-if)#int fa0/0

Busan(config-if)#ip add 200.200.200.1 255.255.255.0

Busan(config-if)#no sh

 

기본 설정을 마친 후, 대구 라우터에 NAT 설정을 해주었다.

 

Daegu(config)#ip nat inside source static 192.168.1.100 100.100.100.100

Daegu(config)#ip nat inside source static 192.168.1.254 100.100.100.101

 

Daegu(config)#int fa0/0

Daegu(config-if)#ip nat outside

 

Daegu(config-if)#int fa0/1

Daegu(config-if)#ip nat inside

 

Daegu(config-if)#do debug ip nat

IP NAT debugging is on

 

라우팅

 

대구 라우팅

 

Daegu(config)#ip route 200.200.200.0 255.255.255.0 1.1.1.2

 

부산 라우팅

 

Busan(config)#ip route 100.100.100.0 255.255.255.0 1.1.1.5

 

ISP 라우팅

 

ISP(config)#ip route 100.100.100.0 255.255.255.0 1.1.1.1

ISP(config)#ip route 200.200.200.0 255.255.255.0 1.1.1.6

 

라우팅 설정을 마치자 호스트간 핑 테스트가 된다.

 

부산 호스트의 DNS 서버를 변환된 서버의 주소를 입력하고 웹 서버에 접속하자 문제없이 접속이 된다.

 

 

 

 

NAT를 활용해 주소를 변환하고, 변환된 주소로 웹 접속을 해보았다.

 

 

 

실습 목표

대구 라우터는 Static NAT를 활용하여 192.168.1.0 > 11.11.11.0 네트워크로 변환한다.

부산 라우터는 192.168.2.0 > 100.100.101.0 네트워크로 변환한다.

모든 호스트간 통신이 가능케 한다. 라우팅 방법은 정적 라우팅을 활용하라.

 

 

 

ISP 라우터 설정

 

ISP(config)#int se0/3/1

ISP(config-if)#ip add 1.1.1.2 255.255.255.252

ISP(config-if)#no sh

 

ISP(config-if)#int se0/2/0

ISP(config-if)#ip add 1.1.1.5 255.255.255.252

ISP(config-if)#no sh

 

ISP(config-if)#int se0/2/1

ISP(config-if)#ip add 1.1.1.9 255.255.255.252

ISP(config-if)#no sh

 

ISP(config-if)#int se0/3/0

ISP(config-if)#ip add 1.1.1.13 255.255.255.252

ISP(config-if)#no sh

 

대구 라우터 설정

 

Daegu(config)#int fa0/0

Daegu(config-if)#ip add 192.168.1.1 255.255.255.0

Daegu(config-if)#no sh

 

Daegu(config-if)#int se0/3/0

Daegu(config-if)#ip add 1.1.1.1 255.255.255.252

Daegu(config-if)#no sh

 

부산 라우터 설정

 

Busan(config)#int fa0/0

Busan(config-if)#ip add 192.168.2.1 255.255.255.0

Busan(config-if)#no sh

 

Busan(config-if)#int se0/3/0

Busan(config-if)#ip add 1.1.1.6 255.255.255.252

Busan(config-if)#no sh

 

울산 라우터 설정

 

Ulsan(config)#int fa0/0

Ulsan(config-if)#ip add 192.168.3.1 255.255.255.0

Ulsan(config-if)#no sh

 

Ulsan(config-if)#int se0/3/0

Ulsan(config-if)#ip add 1.1.1.10 255.255.255.252

Ulsan(config-if)#no sh

 

제주 라우터 설정

 

jeju(config)#int fa0/0

jeju(config-if)#ip add 100.100.100.1 255.255.255.0

jeju(config-if)#no sh

 

jeju(config-if)#int se0/3/0

jeju(config-if)#ip add 1.1.1.14 255.255.255.252

jeju(config-if)#no sh

 

==============================================================

기본 설정을 마치고 nat 설정을 해주었다.

 

대구 라우터 설정

Daegu(config)#ip nat inside source static 192.168.1.100 11.11.11.100

 

Daegu(config)#int se0/3/0

Daegu(config-if)#ip nat outside

 

Daegu(config-if)#int fa0/0

Daegu(config-if)#ip nat inside

 

Daegu(config)#do debug ip nat

IP NAT debugging is on

 >> nat가 발생하면 라우터에 내용이 출력됨.

 

부산 라우터 설정

Dynamic NAT 설정을 위해 ACL 만듦

Busan(config)#access-list 10 permit 192.168.2.0 0.0.0.255

Busan(config)#ip nat pool Busan_NAT 100.100.101.100 100.100.101.140 netmask 255.255.255.0

 > NAT을 통해 변경될 네트워크 범위 입력

Busan(config)#ip nat inside source list 10 pool Busan_NAT

 > 만든 ACL과 NAT를 연결해줌

 

Busan(config)#int fa0/0

Busan(config-if)#ip nat inside

 

Busan(config-if)#int se0/3/0

Busan(config-if)#ip nat outside

 

Busan(config-if)#do debug ip nat

IP NAT debugging is on

 

nat 설정을 마치고, 라우팅 설정을 해준다.

 

대구 라우터

 

Daegu(config)#ip route 100.100.101.0 255.255.255.0 1.1.1.2

Daegu(config)#ip route 100.100.100.0 255.255.255.0 1.1.1.2

Daegu(config)#ip route 192.168.3.0 255.255.255.0 1.1.1.2

 

부산 라우터

 

Busan(config)#ip route 11.11.11.0 255.255.255.0 1.1.1.5

Busan(config)#ip route 100.100.100.0 255.255.255.0 1.1.1.5

Busan(config)#ip route 192.168.3.0 255.255.255.0 1.1.1.5

 

울산 라우터

 

Ulsan(config)#ip route 11.11.11.0 255.255.255.0 1.1.1.9

Ulsan(config)#ip route 100.100.100.0 255.255.255.0 1.1.1.9

Ulsan(config)#ip route 100.100.101.0 255.255.255.0 1.1.1.9

 

제주 라우터

 

jeju(config)#ip route 11.11.11.0 255.255.255.0 1.1.1.13

jeju(config)#ip route 100.100.101.0 255.255.255.0 1.1.1.13

jeju(config)#ip route 192.168.3.0 255.255.255.0 1.1.1.13

 

ISP 라우터

 

ISP(config)#ip route 11.11.11.0 255.255.255.0 1.1.1.1

ISP(config)#ip route 100.100.101.0 255.255.255.0 1.1.1.6

ISP(config)#ip route 100.100.100.0 255.255.255.0 1.1.1.14

ISP(config)#ip route 192.168.3.0 255.255.255.0 1.1.1.10

 

라우팅을 '변환된 주소로' 설정함.

 

 

라우팅을 마치고, 호스트간 핑 테스트를 해보았다.

NAT에 대한 Debug를 On 해두었기 때문에 라우터에서 다음과 같은 메세지가 출력된다.

 

NAT*: s=192.168.1.100->11.11.11.100, d=100.100.100.100 [1]

 

NAT: s=100.100.100.100, d=11.11.11.100->192.168.1.100 [21]

 

NAT*: s=192.168.1.100->11.11.11.100, d=100.100.100.100 [2]

 

NAT: s=100.100.100.100, d=11.11.11.100->192.168.1.100 [22]

 

 

분석하면 다음과 같다

s : 출발지 주소

출발지 주소가 192.168.1.100 이 11.11.11.100 으로 변환되었다.

d : 도착지 주소

변환된 11.11.11.100 주소가 100.100.100.100 호스트로 전송을 완료했다.

 

출발지 주소 100.100.100.100 이 도착지 주소 11.11.11.100 으로 전송을 완료했다.

11.11.11.100 주소가 192.168.1.100 으로 변환되었다.

 

부산 라우터의 경우에도 마찬가지로 설정한 NAT는 잘 동작하였다.

 

NAT: s=192.168.2.100->100.100.101.100, d=100.100.100.100 [12]

 

NAT*: s=100.100.100.100, d=100.100.101.100->192.168.2.100 [30]

 

NAT: s=192.168.2.100->100.100.101.100, d=192.168.3.100 [13]

 

NAT*: s=192.168.3.100, d=100.100.101.100->192.168.2.100 [25]

 

 

저번 ACL 실습시간에 사용했던 토폴로지를 토대로 확장 ACL에 대해 실습해볼 계획이다.

먼저 Internal 라우터에 설정되어 있던 access-list 10 을 지우고, 서로간의 통신이 가능한 기본 설정만 되어있는 상태로 만들어 준다.

 

Internal(config)#no access-list 10

Internal(config)#int fa0/1

Internal(config-if)#no ip access-group 10 out

 

 

===========================================================

실습 목표

주어진 요구사항에 맞추어 확장 ACL을 작성하고, 적용하라

 

실습하기에 앞서 웹 접근을 허용하기 위해 호스트에 다음과 같은 설정을 해주겠다.

DNS 서버를 입력해주고, 호스트에서 DNS 서버로 접속할 수 있도록 해준다.

서버에서 www.test.com을 입력하면 192.168.2.100의 DNS로 접속할 수 있도록 설정해 준다.

FTP 서버 또한 접속이 가능하도록 설정해 준다.

 

호스트에서 접속이 정상적으로 되는 것을 확인 한 후, 실습을 시작한다.

 

 

 1. 확장 ACL 
     
        출발지 네트워크 : 192.168.1.0/24 , 192.168.3.0/24
        목적지 네트워크 : 192.168.2.0/24

  [요구사항 1]

     192.168.1.0/24 > 192.168.2.0/24 : 웹 접근만 거부

 

Internal(config)#access-list 100 deny tcp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 eq 80

Internal(config)#access-list 100 permit ip any any

 >> 모든 ip를 허용함.

     위의 deny만 작성할 경우, 모든 통신이 되지 않으면서 100의 ACL만 동작하기 때문.

 

Internal(config)#int fa0/1

Internal(config-if)#ip access-group 100 out

 

 

192.168.2.0 네트워크에서 웹 접속은 되지 않지만, FTP 서버 접속은 가능함

192.168.3.0 네트워크에서는 모든 통신이 가능하다.

 

  [요구사항 2]

    192.168.1.0/24 > 192.168.2.0/24 : FTP 접근만 거부

 

Internal(config)#no access-list 100

Internal(config)#access-list 101 deny tcp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 eq 21

Internal(config)#access-list 101 permit ip any any

 

Internal(config)#int fa0/1

Internal(config-if)#no ip access-group 100 out

Internal(config-if)#ip access-group 101 out

FTP 서버 접속은 불가능하지만, 웹 서버의 접속은 가능하다는 것을 알 수 있다.

 

  [요구사항 3]

     192.168.1.101/24 > 192.168.2.100/24 : FTP만 접근 가능
     192.168.1.100/24 > 192.168.2.100/24 : 웹만 접근 가능

이번 요구사항은 하나의 네트워크 내의 특정 호스트는 FTP만, 다른 호스트는 웹만 접속이 가능하도록 설정 할 것이다.

 

Internal(config)#no access-list 101

Internal(config)#access-list 102 permit tcp host 192.168.1.101 192.168.2.0 0.0.0.255 eq 21

Internal(config)#access-list 102 permit tcp host 192.168.1.100 192.168.2.0 0.0.0.255 eq 80

 

Internal(config)#int fa0/1

Internal(config-if)#no ip access-group 101 out

Internal(config-if)#ip access-group 102 out

 

.101 호스트에서는 FTP 접속만 가능하고, .100 호스트에서는 웹 접속만 가능하다는 것을 확인할 수 있다.


  [요구사항 4]

     192.168.1.0/24 > 192.168.2.0/24 : 웹만 접근 가능
     192.168.3.0/24 > 192.168.2.0/24 : FTP만 접근 가능

 

Internal(config)#no access-list 102

Internal(config)#access-list 103 permit tcp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 eq 80

Internal(config)#access-list 103 permit tcp 192.168.3.0 0.0.0.255 192.168.2.0 0.0.0.255 eq 21

 

Internal(config)#int fa0/1

Internal(config-if)#no ip access-group 102 out

Internal(config-if)#ip access-group 103 out

 

이번에는 .1.0 네트워크에서는 웹접속만, .3.0 네트워크에서는 ftp만 접속이 가능하도록 설정했다.

 

 

 

설정을 마친 후, .1.0 네트워크는 웹접속만, .3.0 네트워크는 FTP 접속만 되는 것을 확인할 수 있다.

 

실습목표

 - OSPF를 이용해 모든 호스트간의 통신이 가능케 할 것이다.

 - 통신이 가능케 한 후, ACL을 활용하여 192.168.3.100 호스트의 통신만 가능케 할 것이다.

 

 

Internal 라우터 설정

Internal(config)#int fa0/0

Internal(config-if)#ip add 192.168.1.1 255.255.255.0

Internal(config-if)#no sh

 

Internal(config-if)#int fa0/1

Internal(config-if)#ip add 192.168.2.1 255.255.255.0

Internal(config-if)#no sh

 

Internal(config-if)#int se0/3/0

Internal(config-if)#ip add 1.1.1.1 255.255.255.252

Internal(config-if)#no sh

 

Internal(config)#router ospf 1

Internal(config-router)#network 192.168.2.0 0.0.0.255 area 0

Internal(config-router)#network 192.168.1.0 0.0.0.255 area 0

Internal(config-router)#network 1.1.1.0 0.0.0.255 area 0

 

 

External 라우터 설정

 

External(config)#int fa0/0

External(config-if)#ip add 192.168.3.1 255.255.255.0

External(config-if)#no sh

 

External(config-if)#int se0/3/0

External(config-if)#ip add 1.1.1.2 255.255.255.252

External(config-if)#no sh

 

External(config)#router ospf 1

External(config-router)#network 1.1.1.0 0.0.0.255 area 0

External(config-router)#network 192.168.3.0 0.0.0.255 area 0

 

설정을 마치자 모든 호스트간에 통신이 가능하다는 것을 확인할 수 있다.

 

Internal(config)#access-list 10 permit host 192.168.3.100

 > ACL을 만들었다. 192.168.3.100의 호스트'만' 허가한다는 10번의 ACL이다.

Internal(config-if)#int fa0/1

Internal(config-if)#ip access-group 10 out

만든 ACL을 적용하기 위해 Fa0/1 포트에 적용을 했다.]

명령어를 적용하자, 192.168.1.0 와 192.168.2.0 네트워크의 통신이 불가능한 것을 확인했고,

192.168.3.100 호스트만이 192.168.2.100 호스트와 통신이 가능한 것을 확인했다.

 

 >> out의 경우에는 해당 포트로 나갈때 적용한다는 뜻으로, in은 들어오는 경우를 말한다.

 in과 out을 적절하게 사용하여 다양한 상황에 ACL을 만들어 적용시킬 수 있다.

+ Recent posts