명령어

유닉스(또는 리눅스) 시스템에서 고정 IP(static IP)를 설정하는 방법

1. 네트워크 인터페이스에 IP 주소 설정:  sudo ip addr add 203.230.51.3/24 dev eth0

2. 기본 게이트웨이 설정: sudo ip route add default via 203.230.51.1

3. DNS 서버 설정 (예: /etc/resolv.conf 파일에 추가): echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf

 

help lsb_release

info lsb_release 

 

공통

a. SSH 설정 

​! 호스트 이름과 도메인 이름 설정

Router(config)# hostname R1

R1(config)# ip domain-name example.com

 

​! 암호화 키 생성(1024)

R1(config)# crypto key generate rsa

 

​! VTY 라인에 SSH 액세스 활성화

R1(config)# line vty 0 4

R1(config-line)# login local

R1(config-line)# transport input ssh

 

​! 사용자 이름 및 비밀번호 설정

R1(config)# username admin password yourpassword

 

​! SSH 버전 선택

R1(config)# ip ssh version 2

 

​! 확인

R1# show ip ssh

R1# show ssh

 

b. telnet 

Router (config-line) # transport input telnet

Router (config-line) # login local

 

L3 Cisco IOS 장치에서 실행되는 명령어.

a.  네트워크 Static-Routing Table 설정 

 

1. 네트워크 인터페이스 요약 정보: show ip int brief

2. 네트워크 라우트 테이블 정보 (memory): show ip route | being C 

                                                                     show ip route static 

3. 네트워크 route table 정보 (nVRAM): show run | sec route 

4. Static-Routing Table 설정 :  ip route <DST.IP> <Subnet> <IN Interface>

5. Default Static 설정 : ip route 0.0.0.0 0.0.0.0 

 

b. 초기 라우터 장비 설정 

en

conf t

no ip domain lookup

line console 0

logging sync 

 

c. L3 스위치를 라우터로 사용시 장비 설정

no switchport

ip routing 

 

c. DHCP 설정 

R1(config)#ip dhcp excluded-address 163.180.116.1

R1(config)#ip dhcp excluded-address 163.180.116.255 

R1(config)#ip dhcp pool test

R1(dhcp-config)#network 163.180.116.0 255.255.255.0 

R1(dhcp-config)#dns-server 1.1.1.1

R1(dhcp-config)#default-router 163.180.116.1

R1(dhcp-config)#exit

R1(config)#service dhcp

 

show dhcpd state

show dhcpd binding

 

d. 라우터의 Rip 프로토콜 설정 

R1# debug ip rip

R1#  un all

R1#  show ip protocols

R1 (config) route rip

R1 (config-router) network (직접 연결된 네트워크 주소)  

R1 (config-router) passive-interface fa0/0

R1 (config-router) version 1

R1 (config)  int lo 0 

 

* RIP Manual-Summary

R1 (config)  no auto-summary : 다른 라우터로 보내는 정보를 축약하지 않는다. (mannul-summary도 가능)

R1 (config-router) ip summary-address rip 10.0.0.0 255.0.0.0

R1# clear ip route * : 라우팅 테이블을 지우는 명령어

 

* offset-list를 활용한 Metric 조정

R1 (config)# access-list  10 permit 10.0.0.0 0.0.0.255(Wildcard mask) : 트래픽의 범위를 정하는 명령어 **중요

(traffic classification은  Wildcard mask를 통해서 트래픽을 분류한다.)

  예) 255.255.255.0 -> 0.0.0.255

R1 (config)# offset-list 10 in 5

 

*RIP Authentication (MD5)

R1 (config-router) key chain cisco

R1 (config-router) key 7

R1 (config-router) key-string 1029

!

R1 (config-interface) ip rip authentication mode md5
R1 (config-interface)  ip rip authentication key-chain cisco
R1 (config-interface)  exit

 

 

 

*Router 설정 방법

R3(config)#int range GI0/0-3 

R3(config)#int ra gi0/2, gi0/0

 

e. 라우터의 Rip 프로토콜, Eigrp 프로토콜 재분배 설정 

router eigrp 1

network 2.2.2.2 0.0.0.0

network 203.230.8.1 0.0.0.0

redistribute rip metric 1 1 1 1 1

 

router rip

version 2

redistribute eigirp 1 metric 1 (14를 주고 일부로 hop- limitation 설정 가능 ) 

passive-interface GigabitEthernet2

network 2.0.0.0 (Over Config 설정)  

network 203.230.7.0

 

* debug rip

* debug ip packet

 

e-2. 라우터의 Ospf 프로토콜, Static 재분배 설정 

 

router ospf

redistribute static subnets

 

f. OSFP 라우팅 프로토콜

 

* DR/BDR Pri 값 변경

R3(config)# int g0/0 (over - config 를 생각! . 같은 이더넷 BMA 상에만 넣는다)  

R3(config-interface)#  ip ospf priority 255

R3# clear ip ospf process 

R3# show ip ospf neighbor 

 

* Point to Point 이더넷 연결 시 수동으로 DR/BDR 선출 생략

R3(config)# int g0/0

R3(config-interface)# ip ospf network point-to-point 

 

* ospf의 default 셋팅 방법

router ospf 7 (process-id)

router-id 1.1.1.1

network 1.1.1.1 0.0.0.0.0 area 0 (Eigrp는 area가 없다.)  

area 7 stub : Standartd가 아닌 Stub으로 생성 시 

area 7 nssa 

 

* ospf 인증방법

- plain text / Area

router ospf 10

area 0 authenticaion

int gi0/0

ip ospf authenticaion-key cisco

 

- plain text / Per-Interface 인증

ing gi0/0

ip ospf authenticaion

ip ospf authenticaion-key cisco

 

-MD5/Area

router ospf 10

area 0 authenticaion message-digest

int gi0/0

ip ospf message-digest-key 1 md5 cisco

 

-MD5/ Per-Interface 인증

ing gi0/0

ip ospf authenticaion message-digest

ip ospf message-digest-key 1 md5 cisco

 

*EIGRP Authentication (MD5)

Router(config)# key chain EIGRP_KEYCHAIN

Router(config-keychain)# key 1

Router(config-keychain-key)# key-string YOUR_KEY_STRING

Router(config-keychain-key)# exit

 

Router(config)# interface GigabitEthernet0/0

Router(config-if)# ip authentication mode eigrp 1 md5

Router(config-if)# ip authentication key-chain eigrp 1 EIGRP_KEYCHAIN

Router(config-if)# exit

 

G. OSPF-EIGRP Redistribute

router eigrp 10

router-id 2.2.2.2

network 203.230.8.1 0.0.0.0

redistribute ospf 1 metric 1 1 1 1 1

!

router ospf 1

router-id 2.2.2.2

redistribute eigrp 10 subnets

 

H. OSPF의 네트워크 토폴로지를 확인하고 OSPF 라우팅 정보를 검사

show ip ospf database

show ip ospf neighbor

show ip ospf interface

show ip route ospf

 

I. EIGRP 의 네트워크 토폴로지를 확인하고 OSPF 라우팅 정보를 검사

show ip eigrp neighbor

 

J. HSRP (Hot Stanby Routing Protocol)

R1(config)# interface GigabitEthernet0/0

R1(config-if)# ip address 192.168.1.2 255.255.255.0

 

! HSRP 설정

R1(config-if)# standby 1 ip 192.168.1.1

R1(config-if)# standby 1 priority 150

R1(config-if)# standby 1 preempt

R1(config-if)# standby 1 authentication md5 key-string MyHSRPKey

R1(config-if)# exit

 

R1# show stanby brief

 

! HSRP(Hot Standby Router Protocol)에서 track 명령어

Router(config)# track 1 interface gigabitEthernet 0/1 line-protocol

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# standby 1 track 1 decrement 20

 

! VRRP 설정

R2(config-if)# vrrp 1 ip 192.168.1.1

R2(config-if)# vrrp 1 priority 100

R2(config-if)# vrrp 1 preempt

R2(config-if)# vrrp 1 authenticaion md5 key-string cisco

R2(config-if)# vrrp 1 timers advertise 1

R2(config-if)# vrrp 1 timers learn 

 

R2(config-if)# exit

 

! GLBP 설정 

RouterA(config)# interface GigabitEthernet0/1
RouterA(config-if)# glbp 1 ip 192.168.1.1
RouterA(config-if)# glbp 1 priority 120
RouterA(config-if)# glbp 1 preempt
RouterA(config-if)# glbp 1 load-balancing weighted
RouterA(config-if)# glbp 1 weighting 100 lower 60 upper 90

 

L2 Cisco IOS 장치에서 실행되는 명령어.

A. Switch Vlan 설정 

 

! VLAN 생성

Switch(config)# vlan 10

Switch(config-vlan)# name vlan_10

Switch(config)# int vlan 20 : vlan 20 번에 가상 인터페이스를 생성  (SVI : Switched Virtual Interface)

 

! VLAN 삭제

delete flash:vlan.dat 

 

! 포트 할당

Switch(config)# interface GigabitEthernet0/1

Switch(config-if)# switchport mode access 

                     약어 sw m a

Switch(config-if)# switchport access vlan 10

                    약어 sw a v 10

Switch(config-if)# mls qos trust cos  : 특정 인터페이스에서 CoS 값을 신뢰하도록 QoS를 설정

Switch(config-if)# exit

 

Swtich(config)# int range fa 0/2-10 : 사용하는 포트를 제하고 shut

 

! VLAN 생성 확인 

Switch# show vlan br 

Switch# show int trunk 

Switch#  show interface fa0/18 switchport

 

! 트렁크 포트 설정 및 Native VLAN 변경

Switch(config)# interface GigabitEthernet0/1

Switch(config-if)# switchport mode trunk

Switch(config-if)# switchport trunk native vlan 99 (인터페이스 구간에는 동일한 번호로 설정)  

Switch(config-if)# switchport trunk allowed vlan 10,20,99

Switch(config-if)# exit

 

L3 Switch(config-if)# switchport trunk encapsulation dot1q

 

! Inter VLAN Router  

Router(config)# interface GigabitEthernet0/0.10

Router(config-subif)# Description Default Gateway for VLAN 10

Router(config-subif)# encapsulation dot1Q 10

Router(config-subif)# ip address 192.168.10.1 255.255.255.0

Router(config-subif)# exit

Router(config)# interface GigabitEthernet0/0

Router(config-if)# Description Trunk link to S1

Router(config-if)# no shut

 

Router# show arp (Access Device 의 VLAN 확인)

 

! Inter Switch Ether-channel (LACP) 

Switch(config)# interface port-channel 1

Switch(config)# interface range fastEthernet 0/1 - 2

Switch(config-if-range)# no switchport

Switch(config-if-range)# channel-protocol lacp

Switch(config-if-range)# channel-group 1 mode active

 

show etherchannel summary

show interface port-channel 1  

 

! Inter VLAN L3, L2 Switch 

1) ! VLAN 10 생성 및 이름 지정

Switch(config)# vlan 10

Switch(config-vlan)# name VLAN_10

Switch(config-vlan)# exit

 

2)! VLAN 10의 SVI 생성 및 IP 주소 할당

Switch(config)# interface vlan 10

Switch(config-if)# ip address 192.168.10.1 255.255.255.0

Switch(config-if)# encapsulation dot1Q 10

Switch(config-if)# no shutdown

Switch(config-if)# exit

Switch(config)# interface GigabitEthernet0/1

Switch(config-if)# switchport mode trunk

 

3) Switch Management vlan 생성 

Switch(config)# interface vlan 99

Switch(config-if)# ip address 192.168.10.2 255.255.255.0

Switch(config-if)# no shutdown

Switch(config-if)# exit !


Switch(config)# ip default-gateway 192.168.10.1  : 기본 게이트웨이 설정 

 

!Vlan Mode 설정 (VTP VLAN Trunking Protocol)

 

Switch(config)# vtp mode server
Switch(config)# vtp domain mydomain
Switch(config)# vtp version 2
Switch(config)# vtp password mypassword

 

Switch(config)# vtp mode client
Switch(config)# vtp domain mydomain
Switch(config)# vtp version 2
Switch(config)# vtp password mypassword

 

Switch(config)# vtp mode transparent
Switch(config)# vtp domain mydomain
Switch(config)# vtp version 2
Switch(config)# vtp password mypassword

 

! Inter VLAN L3, L2 Switch 

erase start-up config

delete vlan.dat

 

L2 Cisco IOS 장치 고급 설정 (Spanning-Tree)

Switch(config)#  spanning-tree vlan 1 priority 4096

Switch(config-if)# spanning-tree portfast

Switch(config-if)# spanning-tree bpduguard enable 

Switch(config-if)# spanning-tree guard root                ! 루트 브리지가 아닌 스위치의 루트 브리지로 연결된 UPLINK 포트

Switch(config-if)# spanning-tree guard loop               ! Alternate 포트(차단 상태의 포트)에 설정

show spanning-Tree  summary totals

 

 

L3 Cisco IOS 장치 고급 설정 (Access-List) 

! Standard Access Control List

Router(config)# access-list 1 permit 192.168.1.0 0.0.0.255

Router(config)# access-list 10 deny any

Router(config)# interface FastEthernet0/0

Router(config-if)# ip access-group 1 in

 

! Standard Access Control List (VTY)

: 가상 인터페이스에 선언해서 Telnet 접속 차단 

Router(config)# access-list 1 permit 203.230.7.2 0.0.0.0

Router(config)# line vty 0 4

Router(config-line)# ip access-group 1 in

 

! Named Standard Access Control List

Router(config)# ip access-list standard cisco 

Router(config-std-nacl)#deny 1.1.1.0 0.0.0.255  

 

! Extended Access Control List

Router(config)# access-list 100 permit tcp 192.168.1.0 0.0.0.255 any eq 80

Router(config)# access-list 100 deny icmp host 1.1.1.1 any echo log-input

Router(config)# access-list 100 deny ip any any

Router(config)# access-list 101 permit tcp 192.168.1.0 0.0.0.255 any eq 80 log-input

 

! Named Extended  Access Control List

Router(config)# ip access-list entended cisco 

Router(config-std-nacl)#deny tcp any any eq telnet 

Router(config-std-nacl)#permit ip any any 

R2(config)#route-map cisco permit 10
R2(config-route-map)#match ip address 100
R2(config-route-map)#set ip next-hop 203.230.8.2
R2(config-route-map)#exit
R2(config)#access-list 100 permit ip host 10.10.1.1 host 20.20.1.1
R2(config)#int gi0/0
R2(config-if)#ip policy route-map cisco
R2(config-if)#exit

 

! 라우터에서 정책 기반 라우팅 (Distribute-list) 

R-2(config)#access-list 10 permit 10.10.1.0 0.0.254.255
R-2(config)#router eigrp 7
R-2(config-router)#distribute-list 10 in gigabitEthernet 0/0

 

! 라우터에서 정책 기반 라우팅 (prefix-list)
acl 기반 (mask ) 의 설정이 불편할때 

R-3(config)#ip prefix-list net10 permit 10.10.1.0/24
R-3(config)#ip prefix-list net10 permit 10.10.5.0/24
R-3(config)#ip prefix-list net10 permit 172.16.1.0/24
R-3(config)#router eigrp 7
R-3(config-router)#distribute-list prefix net10 in gi0/0

 

 

! 라우터에서 정책 기반 라우팅(PBR)을 설정

R2(config)#route-map cisco permit 10
R2(config-route-map)#match ip address 100
R2(config-route-map)#set ip next-hop 203.230.8.2
R2(config-route-map)#exit
R2(config)#access-list 100 permit ip host 10.10.1.1 host 20.20.1.1
R2(config)#int gi0/0
R2(config-if)#ip policy route-map cisco
R2(config-if)#exit

 

R1# debug ip policy ! 정책 기반 라우팅(PBR, Policy-Based Routing) 정책에 따라 어떻게 처리되는지를 실시간으로 확인

 

! NAT/PAT 실습 

! Static NAT 

R1(config)#interface GigabitEthernet0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#ip nat inside
R1(config-if)#exit

R1(config)#interface GigabitEthernet0/1
R1(config-if)#ip address 203.0.113.1 255.255.255.0
R1(config-if)#ip nat outside
R1(config-if)#exit

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

R1#show ip nat translations

 

! Dynamic NAT 

R1(config)#ip nat pool MY_POOL 203.0.113.10 203.0.113.20 netmask 255.255.255.0

R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255

R1(config)#ip nat inside source list 1 pool MY_POOL

 

! PAT 


access-list 130 permit ip 192.168.30.0 0.0.0.255 any
access-list 140 permit ip 192.168.40.0 0.0.0.255 any
ip nat inside source list 130 interface GigabitEthernet0/0 overload
ip nat inside source list 140 interface GigabitEthernet0/0 overload

 

! Tunneling 

interface Tunnel0
 ip address 10.1.1.1 255.255.255.252
 tunnel source GigabitEthernet0/0
 tunnel destination 203.0.113.2

 

! DMVPN 환경, GRE Multipoint 터널

(Hub)

interface tunnel0

ip address 10.10.10.1 255.255.255.0

tunnel mode gre multipoint tunnel source 100.100.1.1     ! 포크-허브 간에 동적으로 터널을 설정

ip nhrp network 100

ip nhrp map multicast dynamic

no ip split-horizon eigrp 100

no ip next-hop-self eigrp 100

(Spoke)

interface tunnel0

ip address 10.10.10.2 255.255.255.0

tunnel mode gre multipoint tunnel source 100.100.2.1     ! 포크-허브 간에 동적으로 터널을 설정

ip nhrp network 100

ip nhrp nhs 10.10.10.1

ip nhrp map 10.10.10.1 100.100.1.1

ip nhrp map multicast 100.100.1.1

 

! GRE over IPsec VPN

R1(config)# crypto isakmp policy 1       ! 정책 식별 번호 1 설정
R1(config-iskmp)# authentication pre-share  ! 인증 방식으로 사전 공유 키 설정
R1(config-iskmp)# encryption 3des         ! 암호화 알고리즘으로 3DES 사용
R1(config-iskmp)# hash sha                ! 해시 알고리즘으로 SHA 사용
R1(config-iskmp)# group 2                 ! Diffie-Hellman 그룹 2 (1024bit) 사용
R1(config-iskmp)# lifetime 86400          ! 유효 시간 86400초 (24시간) 설정

 

R1(config)# crypto ipsec transform-set cisco esp-3des esp-sha-hmac
! IPSec 보안 정책 및 암호화 인증 알고리즘 지정
R1(config)# crypto isakmp key skills address 203.230.8.2
! 사전 공유 키를 설정 (상대방 IP 주소: 203.230.8.2)
R1(config)# crypto map crmap 1 ipsec-isakmp
! IPSec 암호화 맵 정의 (crmap이라는 이름의 맵, 번호 1)
R1(config-crypto-map)# set transform-set cisco
! 이전에 정의한 transform-set을 사용
R1(config-crypto-map)# set peer 203.230.8.2
! IPSec 터널의 원격지 설정 (상대방 IP 주소: 203.230.8.2)
R1(config-crypto-map)# match address 100
! ACL 100번과 일치하는 트래픽만 IPSec 지원

 

R1(config)# interface gi0/0 ! GigabitEthernet0/0 인터페이스 설정 모드로 진입

R1(config-if)# crypto map crmap ! 암호화 맵 'crmap'을 GigabitEthernet0/0 인터페이스에 적용 (Tunnel SRC 주소) 

 

R1# show crypto ipsec sa

R1# show crypto isakmp sa  !IKE Phase 1 세션을 모니터링

 

Cisco ASA 장치 설정

! ASA ACL 설정 
ciscoasa(config)# access-list dmzping extended permit icmp any host 203.230.10.2
! 이 명령어는 dmzping이라는 이름의 확장된 ACL을 생성하여
! 출발지가 어떤 주소든 상관없이 (any)
! 203.230.10.2 목적지 주소로 향하는 ICMP 트래픽을 허용합니다 (permit icmp).

ciscoasa(config)# access-group dmzping in interface outside

! outside 인터페이스에  들어오는(in) 트래픽에 대해 이 ACL 규칙을 적용합니다.

 

! 설정 내용 저장/ 삭제/  재시작 

ciscoasa>en                        ! 관리자 모드로 전환
password:                          ! 비밀번호 입력 (설정되어 있지 않으면 enter를 치고 넘어간다)
ciscoasa#write memory              ! 설정 내용 저장
ciscoasa#write erase               ! 저장 내용 삭제
ciscoasa#reload                    ! 재시작

 

! 이름변경, enable password 설정, console password 설정 

ciscoasa(config)#hostname ASA                                  ! 호스트 이름을 ASA로 변경
ASA(config)#enable password cisco1029                           ! enable 암호를 cisco1029로 변경
ASA(config)#username cisco password cisco1029                   ! 사용자 cisco / 암호 cisco1029 생성
ASA(config)#aaa authentication serial console LOCAL             ! Console password 구성

 

! IP주소 할당 / zone 구성

ASA(config)#int gi1/1                                    ! 인터페이스 gi1/1 설정 모드로 진입
ASA(config-if)#ip add 192.168.0.1 255.255.255.0          ! IP 주소 192.168.0.1 및 서브넷 마스크 255.255.255.0 설정
ASA(config-if)#nameif inside                             ! 인터페이스 이름을 inside로 설정
INFO: Security level for "inside" set to 100 by default. ! "inside"의 보안 레벨이 기본값으로 100으로 설정됨
ciscoasa(config-if)#security-level 100                   ! 보안 레벨을 100으로 변경 가능

 

ciscoasa# show nameif

 

! DHCP / Router RIPv2 설정 

ASA(config)#dhcp address 192.168.0.10-192.168.0.254 inside    ! DHCP 주소 풀 설정 (192.168.0.10-192.168.0.254)
ASA(config)#dhcp dns 8.8.8.8                                  ! DHCP 클라이언트에게 제공할 DNS 서버 설정 (8.8.8.8)
ASA(config)#dhcp option 3 ip 192.168.0.1                      ! DHCP 옵션 3(게이트웨이) 설정 (192.168.0.1)
ASA(config)#dhcp enable inside                                ! DHCP 서버를 inside 인터페이스에서 활성화

show dhcpd state

show dhcpd binding

 

ASA(config)#router rip                                        ! RIP 라우터 구성 모드로 진입
ASA(config-router)#version 2                                  ! RIP 버전 2 사용 설정
ASA(config-router)#network 203.230.7.0                        ! RIP 네트워크 203.230.7.0 설정
ASA(config-router)#exit                                       ! 라우터 구성 모드 종료
ASA(config-router)#show route                                 ! 라우팅 테이블 확인

 

! NAT 설정
ASA(config)#object network inside-outside                            ! 네트워크 오브젝트 inside-outside 생성
ASA(config-network-object)#subnet 192.168.0.0 255.255.255.0          ! 오브젝트의 서브넷 설정 (192.168.0.0/24)
ASA(config-network-object)#nat (inside,outside) dynamic interface    ! inside에서 outside로의 동적 NAT 설정

 

show nat 

 

! 방화벽 정책 적용 (MPF)
MPF에서 ICMP를 검사한다는 의미는 내부에서 출발한 ICMP 트래픽은 돌아올 때 ASA/PIX를 통과할 수 있다는 뜻

 

! 기존 class-map과 policy-map을 확인 

   no policy-map global_policy 설정을 통해 기존 global_policy 정책을 삭제한다.  

    (기존 정책은 전체를 허용 하고 있음 )


ASA(config)#class-map inspection_default                      ! class-map을 통해 기본 검사 트래픽 매칭, class-map으로 분류
ASA(config-cmap)#match default-inspection-traffic
ASA(config-cmap)#exit

ASA(config)#policy-map global_policy                           ! class-map과 연동 / 트래픽 검사 활성화
ASA(config-pmap)#class inspection_default
ASA(config-pmap-c)#inspect icmp
ASA(config-pmap-c)#inspect http
ASA(config-pmap-c)#inspect dns
ASA(config-pmap-c)#exit
ASA(config)#no service-policy global_policy global             ! 기존 global_policy 제거
ASA(config)#service-policy global_policy global                ! 새로운 global_policy 적용

 

ciscoasa#  show service-policy 

 

! OSPF 추가적인 명령어 

R1# sh ip ospf database router A.A.A.A   ! Lsa 1, Lsa2 패킷 정보 확인 

R1# sh ip ospf database external             ! Lsa4, Lsa5 패킷 정보 확인 (다른 Area)

R1# sh ip ospf database internal              ! Lsa1, Lsa2, Lsa3 패킷 정보 확인 (같은 Area)

 

R1# Redistribute eigrp 10 subnet metric 100                        ! 재분배 metric 100으로 redistribute

R1# Redistribute eigrp 10 metric-type 1 subnet metric 100  ! 재분배 metric 100으로 redistribute  + E1

Router(config-if)# ip ospf cost 100                                        ! 인터페이스 metric 100으로


Router(config-if)# ip ospf network {broadcast | non-broadcast | point-to-point | point-to-multipoint}

 

Router(config-router)#  area 3 nssa default-information-originate

Router(config-router)#  area 0 range 10.0.0.0 255.0.0.0 no-advertise

 

Router(config-router)# area 2 (링크 사이 AREA) virtual-link 4.4.4.4

R1# sh ip ospf virtual-links 

 

! BGP Routing Process

Router(config)# router bgp <as-number>                  ! BGP 프로세스를 시작하고, 해당 라우터의 AS 번호를 설정
Router(config-router)# neighbor <ip-address> remote-as <as-number>  
! 이웃(BGP peer) 라우터의 IP 주소와 원격 AS 번호를 설정
Router(config-router)# neighbor <ip-address> shutdown   ! 설정한 이웃 라우터와의 BGP 세션을 비활성화(셧다운)
Router(config-router)# neighbor <ip-address> password <string>  
! MD5 인증을 위한 비밀번호를 설정하여 BGP 세션을 보호
Router(config-router)# network major-network-number (auto-summary)  
! 특정 네트워크를 BGP에 광고하고, auto-summary로 요약 가능
Router(config-router)# network major-network-number route-map route-map-name  
! 특정 네트워크를 광고할 때 경로 맵(route-map)을 적용하여 제어

 

router (config)# router bgp <AS>                                                                ! Redistribute
router (config-router)# redistribute <IGP> route-map intoBGP
router (config-router)# exit
router (config)# route-map intoBGP permit
router (config-route-map)# match ip address <ACL>
router (config-route-map)# set origin igp
router (config-route-map)# exit
router (config)# access-list <ACL> permit <network>

 

router (config-router)# neighbor 192.168.1.5 remote-as 65001

router (config-router)# neighbor 192.168.1.5 update-source Loopback0

router # show ip bgp summary           ! BGP neighbor  확인

 

router (config-router)# network 101.101.101.6 mask 255.255.255.255 !자신의 RIB와 동일해야 한다 

router (config-router)#  neighbor 101.101.101.6 next-hop-self
do clear ip bgp *

 

! MPLS_VPN, VRF-Routing, MP-BGP 
router (config)# interface fastEthernet 0/0                                                                 
router (config-if)# mpls ip
router # show mpls ldp neighbor          ! MPLS running 확인 및 label advertised 확인 

router # show mpls forwarding-table

 

router (config)# ip vrf BLUE

router (config-vrf)# rd 100:1

router (config-vrf)# route-target export 100:3

router (config-vrf)# route-target import 100:1

 

router (config)# interface loopback 1

router (config-if)# ip vrf forwarding BLUE

router (config-if)# ip address 11.11.11.11 255.255.255.0

router # ping vrf BLUE 11.11.11.11        ! VRF-Routing 확인 

 

! iBGP 세션  IPv4 Unicast로 맺음, BGP는 기본적으로 IPv4 Unicast를 사용

router (config)# router bgp 100

router (config-router)# bgp router-id 1.1.1.1

router (config-router)# neighbor 3.3.3.3 remote-as 100

router (config-router)# neighbor 3.3.3.3 update-source lo 0

 

router (config-router)# address-family vpnv4 unicast                            ! vpnv4 Database 생성 

router (config-router)# neighbor 1.1.1.1 activate

router (config-router)# neighbor 1.1.1.1 send-community extended

 

router (config-router)# address-family ipv4 vrf BLUE

router (config-router)# network 11.11.11.0 mask 255.255.255.0

 

router# sh ip bgp vpnv4 vrf BLUE                        ! vrf 로 광고 된 bgp database 는 해당 명령어로 확인 

router# sh ip route vrf BLUE                                  ! vrf 로 광고 된 라우팅 테이블은  해당 명령어로 확인 

router# sh mpls forwarding-table vrf BLUE         ! vrf 로 광고 된 Label 테이블은 해당 명령어로 확인