ㄴ CCNA

7월 18일 (OSPF 이론, BGP실습)

깜자왕 2022. 7. 18. 18:31
반응형

OSPF Routing Table

1. O : 라우터와 같은 Area에 속하는 네트워크 정보 (Link State)

2. O IA : 라우터와 다른 Area에 속하는 네트워크 정보 (Distance Vector)

 

OSPF 문제점 및 솔루션

=> 높은 CPU 소모량이지만, 최근 하드웨어들은 CPU 성능이 워낙 차고 넘치기에 One Area로 구성한다.

 

서브넷팅

1. FLSM : 모든 네트워크에 동일한 서브넷마스크

2. VLSM : 네트워크마다 다양한 서브넷마스크 

=> IP주소 낭비를 방지하기 위해 VLSM은 필수 (공인IP 환경)

 

OSPF / ISIS / EIGRP 네이버 조건

라우팅 프로토콜 네이버 조건
OSPF Area 번호, 헬로/데드 인터벌 등
IS-IS 링크 레벨
EIGRP AS 번호

BGP 실습

ISP

ip route 0.0.0.0 0.0.0.0 88.1.1.1

 

ISP 1

router bgp 111

bgp log-neighbor-changes

no synchronization

neighbor 88.1.2.2 remote-as 222

network 88.1.1.0 mask 255.255.255.0

 

인터넷

router bgp 222

bgp log-neighbor-changes

no synchronization

neighbor 88.1.2.1 remote-as 111

neighbor 99.1.2.1 remote-as 333

redistribute ospf 1

 

router ospf 1

log-adjacency-changes

network 10.0.0.0 0.255.255.255 area 0

 

R2

router ospf 1

log-adjacency-changes

network 10.0.0.0 0.255.255.255 area 0

ip route 0.0.0.0 0.0.0.0 10.1.1.1

 

ISP 2

router bgp 333

bgp log-neighbor-changes

no synchronization

neighbor 99.1.2.2 remote-as 222

network 99.1.1.0 mask 255.255.255.0

 

ISP

ip route 0.0.0.0 0.0.0.0 99.1.1.1


 

LG

router bgp 661

bgp log-neighbor-changes

no synchronization

neighbor 99.1.1.2 remote-as 881

neighbor 99.1.1.3 remote-as 771

network 66.1.1.0 mask 255.255.255.0

 

KT

router bgp 881

bgp log-neighbor-changes

no synchronization

neighbor 99.1.1.1 remote-as 661

neighbor 99.1.1.3 remote-as 771

neighbor 88.1.2.2 remote-as 1000

network 88.1.1.0 mask 255.255.255.0

 

SK

router bgp 771

bgp log-neighbor-changes

no synchronization

neighbor 99.1.1.1 remote-as 661

neighbor 99.1.1.2 remote-as 881

neighbor 77.1.2.2 remote-as 1000

network 77.1.1.0 mask 255.255.255.0

 

인터넷

interface FastEthernet0/0

ip address 88.1.2.2 255.255.255.0

ip nat outside

duplex auto

speed auto

 

interface FastEthernet1/0

ip address 77.1.2.2 255.255.255.0

ip nat outside

duplex auto

speed auto

 

interface FastEthernet7/0

ip address 10.1.1.1 255.255.255.0

ip ospf 1 area 0

ip nat inside

duplex auto

speed auto

 

interface FastEthernet8/0

ip address 10.1.2.1 255.255.255.0

ip ospf 1 area 0

ip nat inside

duplex auto

speed auto

 

router ospf 1

log-adjacency-changes

default-information originate => ospf 라우터들에게 default 정보를 전달

 

router bgp 1000

bgp log-neighbor-changes

no synchronization

neighbor 88.1.2.1 remote-as 881

neighbor 77.1.2.1 remote-as 771

network 88.1.3.0 mask 255.255.255.0

network 88.1.2.0 mask 255.255.255.0

network 77.1.2.0 mask 255.255.255.0

redistribute ospf 1 => 

 

ip nat inside source list 7 interface FastEthernet1/0 overload => NAT 이중화

ip nat inside source list 8 interface FastEthernet0/0 overload => NAT 이중화

 

ip route 0.0.0.0 0.0.0.0 88.1.2.1 => 라우팅 테이블에 없는 곳으로 보내는 패킷은 static으로 로드밸런싱 한다.

ip route 0.0.0.0 0.0.0.0 77.1.2.1 => 라우팅 테이블에 없는 곳으로 보내는 패킷은 static으로 로드밸런싱 한다.

 

access-list 7 permit any

access-list 8 permit any

 

R1

interface FastEthernet0/0

ip address 10.1.1.2 255.255.255.0

ip ospf 1 area 0

 

interface FastEthernet0/1

ip address 10.1.2.2 255.255.255.0

ip ospf 1 area 0

 

WAN

interface FastEthernet0/0

ip address 10.1.2.3 255.255.255.0

ip ospf 1 area 0

 

interface FastEthernet1/0

ip address 10.1.1.3 255.255.255.0

ip ospf 1 area 0

 

router ospf 1

log-adjacency-changes

redistribute static subnets => 현재 라우터의 static 네트워크를 ospf를 이용해 뿌리겠다

 

ip route 10.1.4.0 255.255.255.0 10.1.3.2

 

R2

ip route 0.0.0.0 0.0.0.0 10.1.3.1


OSPF, BGP, HSRP, NAT, Static 종합 실습

R1

router bgp 551

bgp log-neighbor-changes

no synchronization

neighbor 55.1.4.2 remote-as 881

neighbor 55.1.2.2 remote-as 771

redistribute connected

!

ip classless

ip route 10.1.1.0 255.255.255.0 55.1.3.2

 

R2

interface FastEthernet0/0

ip address 55.1.3.2 255.255.255.0

ip nat outside

duplex auto

speed auto

!

interface FastEthernet0/1

ip address 10.1.1.1 255.255.255.0

ip nat inside

duplex auto

speed auto

 

ip nat inside source list 7 interface FastEthernet0/0 overload

ip route 0.0.0.0 0.0.0.0 55.1.3.1

 

access-list 7 permit any

 

R3

router bgp 771

bgp log-neighbor-changes

no synchronization

neighbor 55.1.2.1 remote-as 551

neighbor 77.1.2.2 remote-as 1000

neighbor 77.1.4.2 remote-as 1100

redistribute connected

 

R4

router bgp 881

bgp log-neighbor-changes

no synchronization

neighbor 55.1.4.1 remote-as 551

neighbor 88.1.4.2 remote-as 1100

neighbor 88.1.2.2 remote-as 1000

redistribute connected

 

R5

interface FastEthernet0/0

ip address 77.1.4.2 255.255.255.0

ip nat outside

 

interface FastEthernet0/1

ip address 88.1.4.2 255.255.255.0

ip nat outside

 

interface FastEthernet1/0

ip address 77.1.3.1 255.255.255.0

 

interface FastEthernet1/1

ip address 77.1.5.1 255.255.255.0

ip ospf 1 area 0

ip nat inside

 

router ospf 1

log-adjacency-changes

default-information originate

!

router bgp 1100

bgp log-neighbor-changes

no synchronization

neighbor 77.1.4.1 remote-as 771

neighbor 88.1.4.1 remote-as 881

network 77.1.3.0 mask 255.255.255.0

network 77.1.5.0 mask 255.255.255.0

network 77.1.4.0 mask 255.255.255.0

network 88.1.4.0 mask 255.255.255.0

!

ip nat inside source list 3 interface FastEthernet0/0 overload

ip nat inside source list 4 interface FastEthernet0/1 overload

ip classless

ip route 77.1.6.0 255.255.255.0 77.1.5.2

ip route 0.0.0.0 0.0.0.0 77.1.4.1

ip route 0.0.0.0 0.0.0.0 88.1.4.1

!

ip flow-export version 9

!

!

access-list 3 permit any

access-list 4 permit any

 

R6

interface FastEthernet0/0

ip address 88.1.2.2 255.255.255.0

ip nat outside

duplex auto

speed auto

 

interface FastEthernet6/0

ip address 77.1.2.2 255.255.255.0

ip nat outside

duplex auto

speed auto

!

interface FastEthernet7/0

ip address 10.10.3.1 255.255.255.0

ip ospf 1 area 0

ip nat inside

duplex auto

speed auto

!

interface FastEthernet8/0

ip address 10.10.1.1 255.255.255.0

ip ospf 1 area 0

ip nat inside

duplex auto

speed auto

 

router ospf 1

log-adjacency-changes

default-information originate

!

router bgp 1000

bgp log-neighbor-changes

no synchronization

neighbor 77.1.2.1 remote-as 771

neighbor 88.1.2.1 remote-as 881

network 88.1.3.0 mask 255.255.255.0

redistribute ospf 1

!

ip nat inside source list 1 interface FastEthernet6/0 overload

ip nat inside source list 2 interface FastEthernet0/0 overload

ip classless

ip route 0.0.0.0 0.0.0.0 77.1.2.1

ip route 0.0.0.0 0.0.0.0 88.1.2.1

!

ip flow-export version 9

!

!

access-list 1 permit any

access-list 2 permit any

 

R7

interface FastEthernet0/0

ip address 10.10.200.10 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/1

ip address 10.10.100.10 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

 

router ospf 1

log-adjacency-changes

redistribute static subnets

!

ip classless

ip route 10.10.6.0 255.255.255.0 10.10.5.1

 

R8

ip route 0.0.0.0 0.0.0.0 10.10.5.2

 

SW1

interface FastEthernet0/1

no switchport

ip address 77.1.5.2 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/2

no switchport

ip address 77.1.6.1 255.255.255.0

duplex auto

speed auto

!

interface FastEthernet0/3

switchport access vlan 10

switchport mode access

switchport nonegotiate

!

interface FastEthernet0/4

switchport access vlan 20

switchport mode access

switchport nonegotiate

!

interface FastEthernet0/5

switchport access vlan 30

switchport mode access

switchport nonegotiate

 

interface Vlan10

mac-address 0001.43bb.8101

ip address 77.1.7.1 255.255.255.0

!

interface Vlan20

mac-address 0001.43bb.8102

ip address 77.1.8.1 255.255.255.0

ip helper-address 77.1.7.3

!

interface Vlan30

mac-address 0001.43bb.8103

ip address 77.1.9.1 255.255.255.0

ip helper-address 77.1.7.3

!

router ospf 1

log-adjacency-changes

!

ip classless

ip route 77.1.6.0 255.255.255.0 77.1.6.2

ip route 77.1.10.0 255.255.255.0 77.1.6.2

ip route 77.1.11.0 255.255.255.0 77.1.6.2

ip route 77.1.12.0 255.255.255.0 77.1.6.2

 

SW2

interface Port-channel1

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/1

no switchport

ip address 77.1.6.2 255.255.255.0

duplex auto

speed auto

!

interface FastEthernet0/2

switchport trunk encapsulation dot1q

switchport mode trunk

channel-group 1 mode on

!

interface FastEthernet0/3

switchport trunk encapsulation dot1q

switchport mode trunk

channel-group 1 mode on

 

interface Vlan10

mac-address 0090.2195.2b01

ip address 77.1.10.1 255.255.255.0

!

interface Vlan20

mac-address 0090.2195.2b02

ip address 77.1.11.1 255.255.255.0

!

interface Vlan30

mac-address 0090.2195.2b03

ip address 77.1.12.1 255.255.255.0

!

ip classless

ip route 0.0.0.0 0.0.0.0 77.1.6.1

 

SW3

interface FastEthernet0/1

no switchport

ip address 10.10.1.2 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/2

no switchport

ip address 10.10.2.1 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/3

no switchport

ip address 10.10.30.1 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/4

no switchport

ip address 10.10.100.11 255.255.255.0

ip ospf 1 area 0

 

SW4

interface FastEthernet0/1

no switchport

ip address 10.10.3.2 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/2

no switchport

ip address 10.10.40.1 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/3

no switchport

ip address 10.10.4.1 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/4

no switchport

ip address 10.10.200.11 255.255.255.0

ip ospf 1 area 0

 

SW5

interface FastEthernet0/1

no switchport

ip address 10.10.2.2 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/2

no switchport

ip address 10.10.40.2 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/3

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/4

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/5

switchport trunk encapsulation dot1q

switchport mode trunk

 

interface Vlan10

mac-address 0060.7065.3c01

ip address 10.10.7.3 255.255.255.0

standby 10 ip 10.10.7.1

standby 10 priority 150

standby 10 preempt

!

interface Vlan20

mac-address 0060.7065.3c02

ip address 10.10.8.3 255.255.255.0

standby 20 ip 10.10.8.1

standby 20 priority 50

!

router ospf 1

log-adjacency-changes

network 10.10.7.0 0.0.0.255 area 0

network 10.10.8.0 0.0.0.255 area 0

 

SW6

interface FastEthernet0/1

no switchport

ip address 10.10.30.2 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/2

no switchport

ip address 10.10.4.2 255.255.255.0

ip ospf 1 area 0

duplex auto

speed auto

!

interface FastEthernet0/3

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/4

switchport trunk encapsulation dot1q

switchport mode trunk

!

interface FastEthernet0/5

switchport trunk encapsulation dot1q

switchport mode trunk

 

interface Vlan10

mac-address 000b.be35.3d01

ip address 10.10.7.4 255.255.255.0

standby 10 ip 10.10.7.1

standby 10 priority 50

!

interface Vlan20

mac-address 000b.be35.3d02

ip address 10.10.8.4 255.255.255.0

standby 20 ip 10.10.8.1

standby 20 priority 150

standby 20 preempt