본문 바로가기
Network/MPLS

[Network /MPLS] MPLS - OSPF 를 이용한 구성

by JINJINC 2023. 4. 25.
728x90
반응형

구성

 스텝 1 . EIGRP AS 100 구성

<R1>
router eigrp 100
 network 1.1.1.1 0.0.0.0
 network 1.1.12.1 0.0.0.0

<R2>
router eigrp 100
 network 1.1.2.2 0.0.0.0
 network 1.1.12.2 0.0.0.0
 network 1.1.23.1 0.0.0.0

<R3>
router eigrp 100
 network 1.1.3.3 0.0.0.0
 network 1.1.23.2 0.0.0.0
 network 1.1.34.1 0.0.0.0

<R4>
router eigrp 100
 network 1.1.4.4 0.0.0.0
 network 1.1.34.2 0.0.0.0

 스텝 2.  BGP AS 100 구성

<R1>
router bgp 100
 neighbor 1.1.4.4 remote-as 100
 neighbor 1.1.4.4 update-source loopback 0
<R4>
router bgp 100
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 update-source Loopback0

 스텝3. MPLS 구성

<R1,R2,R3,R4>
ip cef
mpls label protocol ldp
mpls ldp router-id loopback 0
<R1>
int g0/2
 mpls ip
<R2>
int g0/1
  mpls ip
int g0/0
  mpls ip
<R3>
int g0/0
  mpls ip 
int g0/1
  mpls ip
<R4>
int g0/1
  mpls ip

 스텝 4 . VRF 구성

<R5>
router ospf 1
 network 2.2.12.1 0.0.0.0 area 0
 network 192.168.10.2 0.0.0.0 area 0
<R7>
router ospf 2
 network 3.3.12.2 0.0.0.0 area 0
 network 192.168.20.2 0.0.0.0 area 0
<R6>
router ospf 1
 network 22.2.12.2 0.0.0.0 area 0
 network 192.168.11.2 0.0.0.0 area 0
<R8>
router ospf 2
 network 33.2.12.2 0.0.0.0 area 0
 network 192.168.21.2 0.0.0.0 area 0
[VRF 설정]
<R1>
Router(config)#ip vrf A
Router(config-vrf)#rd 1:1
Router(config-vrf)#route-target 1:1
Router(config-vrf)#
Router(config-vrf)#int g0/1
Router(config-if)#ip vrf forwarding A
% Interface GigabitEthernet0/1 IPv4 disabled and address(es) removed due to enabling VRF A
Router(config-if)#ip add 2.2.12.2 255.255.255.0
Router(config)#ip vrf C
Router(config-vrf)#rd 3:3
Router(config-vrf)#route-target 3:3
Router(config-vrf)#exit
Router(config)#int g0/0
Router(config-if)#ip vrf forwarding C
Router(config-if)#ip add 3.3.12.1 255.255.255.0
<R4>
R4(config)#ip vrf B
R4(config-vrf)#rd 2:2
R4(config-vrf)#route-tar
R4(config-vrf)#route-target 2:2
R4(config-vrf)#
R4(config-vrf)#int g0/0
R4(config-if)#ip vrf forwarding B
% Interface GigabitEthernet0/0 IPv4 disabled and address(es) removed due to enabling VRF B
R4(config-if)#ip add 22.2.12.1 255.255.255.0
R4(config-if)#exit
R4(config)#ip vrf D
R4(config-vrf)#rd 4:4
R4(config-vrf)#route-target 4:4
R4(config-vrf)#int g0/2
R4(config-if)#ip vrf forwarding D
% Interface GigabitEthernet0/2 IPv4 disabled and address(es) removed due to enabling VRF D
R4(config-if)#ip add 33.2.12.1 255.255.255.0

 

 스텝5 .BGP를 이용 해 VRF 간  재분배 구성

<R1>
Router(config)#router ospf 1 vrf A
Router(config-router)#redi
Router(config-router)#redistribute bgp 100 subnet
Router(config-router)#net 2.2.12.2 0.0.0.0 area 0
Router(config-router)#exit
Router(config)#router ospf 2 vrf 2
*Apr 25 00:58:58.677: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.10.2 on GigabitEthernet0/1 from LOADING to FULL, Loading Don

Router(config)#router ospf 2 vrf C
Router(config-router)#redistribute bgp 100 subnet
Router(config-router)#net
Router(config-router)#network 3.3.12.1 0.0.0.0 area 0
Router(config-router)#exit


Router(config)#router bgp 100
Router(config-router)#neighbor 1.1.4.4 remote-as 100
Router(config-router)#neighbor 1.1.4.4 update-source loopback 0

Router(config-router)#address-family vpnv4

Router(config-router-af)#neighbor 1.1.4.4 activate
Router(config-router-af)#neighbor 1.1.4.4 send-community both
Router(config-router-af)#exit

Router(config-router)#address-family ipv4 vrf A
Router(config-router-af)#redistribute ospf 1
Router(config-router-af)#exit

Router(config-router)#address-family ipv4 vrf C
Router(config-router-af)#redistribute ospf 2
Router(config-router-af)#exit
Router(config-router)#exit

Router(config)#ip vrf A
Router(config-vrf)#route-target import 2:2
Router(config-vrf)#exit
Router(config)#ip vrf C
Router(config-vrf)#route-target import 4:4

<R4>
R4(config)#router ospf 1 vrf B
R4(config-router)#redistribute bgp 100 subnet
R4(config-router)#net 22.2.12.1 0.0.0.0 area 0
R4(config-router)#exit

R4(config)#router ospf 2 vrf D
R4(config-router)#redistribute bgp 100 subnet
R4(config-router)#net 33.2.12.1 0.0.0.0 area 0
R4(config-router)#exit

R4(config)#router bgp 100
R4(config-router)#address-family vpnv4
R4(config-router-af)#neighbor 1.1.1.1 activate
R4(config-router-af)#neighbor 1.1.1.1 send-community both
R4(config-router-af)#exit

R4(config-router)#address-family ipv4 vrf B
R4(config-router-af)#redistribute ospf 1
R4(config-router-af)#exit

R4(config-router)#address-family ipv4 vrf D
R4(config-router-af)#redistribute ospf 2

R4(config)#ip vrf B
R4(config-vrf)#route-target import 1:1
R4(config-vrf)#exit

R4(config)#ip vrf D
R4(config-vrf)#route-target import 3:3

 

 BGP 를 이용해 공인 네트워크 구성

<R9>
router bgp 200
neighbor 5.5.12.2 remote-as 100
network 192.168.30.0 mask 255.255.255.0
<R1>
router bgp 100
neighbor 5.5.12.1 remote-as 200
neighbor 1.1.4.4 next-hop-self
<R4>
router bgp 100
neighbor 6.6.12.2 remote-as 200
neighbor 1.1.1.1 next-hop-self
<R10>
router bgp 300
neighbor 6.6.12.1 remote-as 100
network 192.168.31.0 255.255.255.0

 결과

r1 show bgp all
r4. show bgp all
R1 show ip route
r4 show ip route
R1 . show mpls forwarding-table
R4.show mpls forwarding

VRF A ---- VRF B

VRF C ---- VRF D

728x90
반응형

댓글