본문 바로가기

About../Network

default gateway originate

CCNP(BSCI)

1.라우터가 default gateway를 가지는 경우

   - 자신이 default routing을 가지고 있어야 한다.(dP:static routing)

   - 다른 라우터로부터 dynamic routing등을 통해 default routing을 전달 받는 경우

   - 단, no ip classless(classful routing)의 경우 목적지 주소가 해당 major에 포함 되는데 라우

     팅 테이블에는 없을 때에는 drop(default를 참조하지 않는다.)

     목적지 주소가 major network에 해당되지 않을 경우 default gateway 참조

   

2. 라우팅 테이블에도 없고 default routing도 없는 경우

    - ip classless

       : summary 등을 참조하거나 drop된다.

    - no ip classless

       : 라우팅 테이블에 목적지 주소에 대한 것이 없으면 drop

   

현재 라우터와의 관계라는 점에서 볼 때 default gateway는 해당 라우터가 테이블에 없는 패킷을 처리하기 위한 경로이며 실제 존재하지 않는 목적지 주소로 가더라도 위의 설명을 참고 하되 일반적으로는 default gateway의 경로를 따라 전송됩니다.

결국 자기가 default gateway를 지정해서 가지고 있던지 아니면 다른 라우터로부터 자기가 속한 망에 없는 다른 네트워크 목적지로 가기위해 지정한 경로를 전달 받게 됩니다.

Default-information originate 라는 명령어는 ospf 라우팅 프로토콜위에 설정하는 명령어로써 의미는 core 라우터에 설정을 하여 자신이 디폴트 게이트 웨이이다. 즉, 디폴트 라우터 이다 라는 내용을 하위 라우터들에게 광고를 함으로써 라우팅 테이블에 목적지 ip가 없는 경우에 디폴트 라우터에게 향하게 되며 core 라우터를 통하여 isp로 빠져나가게 된다.

Show ip rouote 를 하게 되면 설정된 값을 확인 할 수 있다.

명령어는 다음과 같다!

default-information originate [always] [metric metric-value] [metric-type type-value] [route-map map-name]

no default-information originate [always] [metric metric-value] [metric-type type-value] [route-map map-name]

Syntax Description

always

(Optional) Always advertises the default route regardless of whether the software has a default route.

metric metric-value

(Optional) Metric used for generating the default route. If you omit a value and do not specify a value using the default-metric router configuration command, the default metric value is 10. The value used is specific to the protocol.

metric-type type-value

(Optional) External link type associated with the default route advertised into the OSPF routing domain. It can be one of the following values:

1—Type 1 external route

2—Type 2 external route

The default is type 2 external route.

route-map map-name

(Optional) Routing process will generate the default route if the route map is satisfied.

   

Route-map

정책 세우기!!!

   

access-list 100 permit ip 172.12.0.0 0.0.0.255 172.11.0.0 0.0.0.255

   

route-map nexthop permit 10

   

route-map 을 만들겠다 map 이름은 nexthop 이다. permit 하겠다

   

match ip add 100은 access 100번을 하겠다.

   

set 명령어는 대부분이 bgp 명령어이다.

   

set ip next-hop 192.168.1.6 src ip가 메치가 되면 192.168.1.6으로 메치를 하여라!

   

ip policy route-map nexthop

내가 정책적인 라우팅을 할때 라우터 맵으로 지정된 이름(nexthop)에 따라 정책을 따르겠다. 이건 인바운드에만 적용된다. 아웃바운드는 안된다.

   

ip route-cache policy

실행 (적용) 시키겠당! 케쉬시키겠다.

   

rib 라우팅 인포메이션 프로토콜

   

fib 포워딩 인포메이션 프로토콜

포워딩 기능에 있는 케쉬를 사용하여 처리하는 기능이다.! 3640은 기본으로 fip가 설정 되어 있다.

   

cef 시스코에서 빠른 패킷 처리기능을 위해 만들어진 명령어. 모든 인터페이스에 적용이 된다.

   

no ip cef 를 하게 되면 fib가 아닌 rib로 적용이 된다.

Route-map을 이용한 PBR 구성하기

   

   

   

   

  LAB: Dynamips 서버를 2개를 실행한다.

PC로 활용할 라우터에 Image를 ram 32M 정도로도 구현되는 파일을 사용한다.

   

## Dynagen Network File

   

[localhost]

autostart = true

   

[[3640]]

image = d:\ios\c3640-jk9o3s-z.123-8.T3.bin

ram = 96

slot0 = NM-1FE-TX

slot1 = NM-4T

idlepc = 0x6055c000

# idlepc = 0x603bc51c

   

[[Router R11]]

model = 3640

console = 2001

f0/0 = NIO_gen_eth:\Device\NPF_{B279075D-E2EE-4893-9CD3-55420E114881}

   

[[Router BND]]

model = 3640

console = 2002

s1/0 = R11 s1/0

s1/1 = R12 s1/0

f0/0 = PC1 f0/0

   

[[Router R12]]

model = 3640

console = 2003

   

   

# Dynamips Secondary Server

   

[localhost:7201]

autostart = true

udp = 20000

   

[[3640]]

image = d:\ios\c3640-i-mz.123-9a.bin

ram = 32

slot0 = NM-1FE-TX

idlepc = 0x603bc51c

   

[[Router PC1]]

model = 3640

console = 2004

   

   

   

### Router PC 사용하려면 다음 구성을 한다.

Router(config)# hostname PC1

PC1(config)# no ip routing

PC1(config)# int fa0/0

PC1(config-if)# ip address 192.168.1.2 255.255.255.0

PC1(config-if)# no shutdown

PC1(config-if)# exit

PC1(config)# ip default-gateway 192.168.1.1

   

Distribute-list를 통한 root filtering

디스트리뷰트-리스트를 이용한 경로찬단 방법

   

방법1.특정 인터페이스를 통하여 송.수신되는 경로를 제어하는 방법...

   

R2설정....

   

int fa0/0

 ip address 10.1.12.2 255.255.255.0

 no shut

   

int s0/0

 ip address 10.1.23.2 255.255.255.0

 encap frame-relay

 frame-relay map ip 10.1.123.3 123 broadcast

   

router eigrp 1

 network 10.1.12.0 0.0.0.255

 no auto-summary

   

   

router rip

 passive-interface fa0/0

network 10.0.0.0

 redistribute eigrp 1 metric 1

   

distribute 1 in s0/0-----s0/0 인터페이스를 통하여 rip업데이트를 받을(in)때  10.1.1.0/24는 차단한다....

access-list 1 deny 10.1.1.1 0.0.0.255

access-list 1 permit any

   

   

   

distribute-list 명령을 사용하면, 라우터가 어떤 라우터에 관한 업데이트를 보내고 받을지를 선택할 수 있다..

distribute-list는 액세스 리스트를 참조하여 라우트 필터 생성한다

라우트 필터 라우터가 라우팅 업데이트 안에 어느 라우팅 테이블들을 보내고 받을지를 세밀하게 제어하는 규칙들의 집합이다..

   

이 명령은 모든 ip  라우팅 프로토콜들에 대해 사용 가능하다..

   

#distribute-list 1 out 는 라우터에 연결된 인터페이스로 나가는 업데이트 뿐만아니라 모든 인터페이스로 나가는 RIP업데이트에 여향을 미친다.....

   

내부로 들어오는 업데이트

   

# distribute-list 1 in e0 ----e0인터페이스를 통하여 내부로 들어오는  업데이트

   

   

   

외부로 나가는 업데이트

   

# distribute-list 1 out s0 ----s0를 통하여 외부로 나가는 업데이트

   

   

   

방법2.특정 라우팅 프로세스에서 다른 라우팅 프로세스를 리디스트리뷰션 되는 경로를 직접 제어하는 방법...

   

라우팅 프로세스간 리디스트리뷰션을 할 때  distribute-list 1 out를 사용한다...

   

라우팅 프로세스간 리기스트리뷰션을 할 때  distribute-list 1 in과 같은 명령어는 없으며, 있다해도 의미가 없다...

   

distribute-list 1 out rip의 의미는

"ip 에서 수신 할때 특정 경로를 제어 하겠다"

   

router rip

  distribute-list 1 out igrp 1

!

   

access-list 1 permit 10.2.3.0 0.0.0.255

# Distribute-list

   

   

- 설정 방법 :

   

Router(config-router)# distribute-list ?

   

  <1-199>        IP access list number

  <1300-2699>  IP expanded access list number

  WORD          Access-list name

  gateway       Filtering incoming updates based on gateway

  prefix           Filter prefixes in routing updates

   

Router(config-router)# distribute-list 113

   

  in   Filter incoming routing updates

  out  Filter outgoing routing updates

   

Router(config-router)# distribute-list 113 [Interface | Routing Protocol]

   

   

1) Outbound 경로 정보 필터링

   

- BB1 재분배되서 들어오는 업데이트 Loopback 0 정보를 받아 들이지 않기를 원한다.

- R1 R2에서 설정 실시

   

   

# R1, R2 (ACL 사용)

   

en

conf t

!

ip access-list standard LB0

deny 1.1.1.0 0.0.0.255

deny 2.2.2.0 0.0.0.255

deny 3.3.3.0 0.0.0.255

deny 4.4.4.0 0.0.0.255

deny 6.6.6.0 0.0.0.255

permit any

!

router ospf 1

distribute-list LB0 out rip

end

!

   

# R1, R2 (Prefix-list 사용)

   

en

conf t

!

ip prefix-list LB0 seq 10 deny 1.1.1.0/24

ip prefix-list LB0 seq 20 deny 2.2.2.0/24

ip prefix-list LB0 seq 30 deny 3.3.3.0/24

ip prefix-list LB0 seq 40 deny 4.4.4.0/24

ip prefix-list LB0 seq 50 deny 6.6.6.0/24

ip prefix-list LB0 seq 60 permit 0.0.0.0/0 le 32

!

router ospf 1

distribute-list prefix LB0 out rip

end

!

   

   

2) Inbound 경로 정보 필터링

   

- BB1 재분배되서 들어오는 업데이트 Loopback 0 정보를 받아 들이지 않기를 원한다.

- BB1에서 설정

   

   

# BB1 (ACL 사용)

   

en

conf t

!

ip access-list standard LB0

deny 1.1.1.0 0.0.0.255

deny 2.2.2.0 0.0.0.255

deny 3.3.3.0 0.0.0.255

deny 4.4.4.0 0.0.0.255

deny 6.6.6.0 0.0.0.255

permit any

!

router ospf 1

distribute-list LB0 in serial 0/0

end

!

   

# BB1 (Prefix-list 사용)

   

en

conf t

!

ip prefix-list LB0 seq 10 deny 1.1.1.0/24

ip prefix-list LB0 seq 20 deny 2.2.2.0/24

ip prefix-list LB0 seq 30 deny 3.3.3.0/24

ip prefix-list LB0 seq 40 deny 4.4.4.0/24

ip prefix-list LB0 seq 50 deny 6.6.6.0/24

ip prefix-list LB0 seq 60 permit 0.0.0.0/0 le 32

!

router ospf 1

distribute-list prefix LB0 in serial 0/0

end

!

Distribute List

  • 전달되는 routing information 일부 혹은 전부를 차단하거나 허용할 있는 역할
  • 불필요한 routing information 전달되는 것을 차단
  • 특정한 routing information 전달될 있도록
  • routing information 제어하여 네트웍의 라우팅문제 해결
  • routing information 전달로 인한 대역소모를 방지
  • standard access list 이용하여 어떤 목적지에 대한 정보를 차단할지 허용할지 결정
  • 목적지 Network Address source address 간주
  • incoming outcoming 양방향으로 제어 가능
  • router(config-router)# distribute-list access-list-number {in|out} [interface-name | routing-process]

    IGRP 109 있는 192.168.7.0 대한 정보만을 IGRP 71 재분배

    IGRP 109 있는 192.168.7.0만을 제외하고 나머지 정보를 IGRP 71 재분배

    IGRP 109 있는 192.168.7.0만을 제외하고 나머지 모든 정보는 interface serial 0 전달

       

   

Microsoft Office OneNote 2007을 사용하여 작성했습니다.
모든 노트 및 정보를 한 곳에서 볼 수 있습니다.