Answers
A1
HQ-RT1:
conf t
!
int eth 0/0
no shut
!
int eth 0/0.10
encapsulation dot1Q 10
ip add 192.168.10.1 255.255.255.0
no shut
!
int eth 0/0.20
encapsulation dot1Q 20
ip add 192.168.20.1 255.255.255.0
no shut
!
int eth 1/0
ip add 100.1.1.1 255.255.255.0
no shut
!
end
HQ-RT2:
conf t
!
int eth 0/0
no shut
!
int eth 0/0.10
encapsulation dot1Q 10
ip add 192.168.10.2 255.255.255.0
no shut
!
int eth 0/0.20
encapsulation dot1Q 20
ip add 192.168.20.2 255.255.255.0
no shut
!
int eth 1/0
ip add 100.1.2.2 255.255.255.0
no shut
!
end
HQ-RT3:
conf t
!
int eth 0/0
no shut
!
int eth 0/0.10
encapsulation dot1Q 10
ip add 192.168.10.3 255.255.255.0
no shut
!
int eth 0/0.20
encapsulation dot1Q 20
ip add 192.168.20.3 255.255.255.0
no shut
!
end
HQ-RT4:
conf t
!
int eth 0/0
no shut
!
int eth 0/0.10
encapsulation dot1Q 10
ip add 192.168.10.4 255.255.255.0
no shut
!
int eth 0/0.20
encapsulation dot1Q 20
ip add 192.168.20.4 255.255.255.0
no shut
!
end
HQ-SW1:
conf t
!
vlan 10,20
!
int eth 0/0
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
no shut
!
int eth 0/1
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
no shut
!
int eth 1/0
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
no shut
!
int eth 1/1
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
no shut
!
end
HQ-SW2,3:
conf t
!
vlan 10,20
!
int eth 0/0
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
no shut
!
int eth 0/1
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
no shut
!
int eth 0/2
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
no shut
!
end
A2
HQ-SW1:
conf t
!
spanning-tree mode rapid-pvst
spanning-tree vlan 10,20 priority 4096
!
end
HQ-SW2,3:
conf t
!
spanning-tree mode rapid-pvst
!
end
A3
BA-RT1:
conf t
!
!
router ospf 100
router-id 1.1.1.1
network 172.16.1.0 0.0.0.255 area 0
network 172.16.2.0 0.0.0.255 area 0
!
int eth 0/0
ip ospf network point-to-point
!
int eth 0/1
ip ospf network point-to-point
!
end
BA-RT2:
conf t
!
router ospf 100
router-id 2.2.2.2
network 172.16.1.0 0.0.0.255 area 0
network 172.16.3.0 0.0.0.255 area 1
!
int eth 0/0
ip ospf network point-to-point
!
int eth 0/1
ip ospf network point-to-point
!
end
BA-RT3:
conf t
!
router ospf 100
router-id 3.3.3.3
network 172.16.2.0 0.0.0.255 area 0
network 172.16.4.0 0.0.0.255 area 1
!
int eth 0/0
ip ospf network point-to-point
!
int eth 0/1
ip ospf network point-to-point
!
end
BA-RT4:
conf t
!
router ospf 100
router-id 4.4.4.4
network 172.16.3.0 0.0.0.255 area 1
network 172.16.4.0 0.0.0.255 area 1
!
int eth 0/0
ip ospf network point-to-point
!
int eth 0/1
ip ospf network point-to-point
!
end
A4
HQ-RT1:
conf t
!
track 1 interface ethernet 1/0 line-protocol
!
interface Ethernet0/0.10
standby version 2
standby 4010 ip 192.168.10.254
standby 4010 priority 110
standby 4010 preempt
standby 4010 track 1 decrement 255
!
interface Ethernet0/0.20
standby version 2
standby 4020 ip 192.168.20.254
standby 4020 preempt
standby 4020 track 1 decrement 255
!
end
HQ-RT2:
conf t
!
track 1 interface ethernet 1/0 line-protocol
!
interface Ethernet0/0.10
standby version 2
standby 4010 ip 192.168.10.254
standby 4010 preempt
standby 4010 track 1 decrement 255
!
interface Ethernet0/0.20
standby version 2
standby 4020 ip 192.168.20.254
standby 4020 priority 110
standby 4020 preempt
standby 4020 track 1 decrement 255
!
end
HQ-RT3:
conf t
!
vrf definition BLUE
!
address-family ipv4
exit-address-family
vrf definition RED
!
address-family ipv4
exit-address-family
!
interface Ethernet0/0.10
vrf forwarding RED
ip address 192.168.10.3 255.255.255.0
!
interface Ethernet0/0.20
vrf forwarding BLUE
ip address 192.168.20.3 255.255.255.0
!
ip route vrf RED 0.0.0.0 0.0.0.0 Ethernet0/0.10 192.168.10.254
ip route vrf BLUE 0.0.0.0 0.0.0.0 Ethernet0/0.20 192.168.20.254
!
end
HQ-RT4:
conf t
!
vrf definition BLUE
!
address-family ipv4
exit-address-family
vrf definition RED
!
address-family ipv4
exit-address-family
!
interface Ethernet0/0.10
vrf forwarding RED
ip address 192.168.10.4 255.255.255.0
!
interface Ethernet0/0.20
vrf forwarding BLUE
ip address 192.168.20.4 255.255.255.0
!
ip route vrf RED 0.0.0.0 0.0.0.0 Ethernet0/0.10 192.168.10.254
ip route vrf BLUE 0.0.0.0 0.0.0.0 Ethernet0/0.20 192.168.20.254
!
end
A5
HQ-RT1 :
conf t
!
router bgp 65001
bgp router-id 100.100.100.100
neighbor 100.1.1.254 remote-as 10000
!
end
HQ-RT2 :
conf t
!
router bgp 65001
bgp router-id 200.200.200.200
neighbor 100.1.2.254 remote-as 10000
!
end
Internet-RT1 :
conf t
!
router bgp 10000
bgp router-id 8.8.8.8
neighbor 100.1.1.1 remote-as 65001
neighbor 100.1.2.2 remote-as 65001
neighbor 100.1.3.1 remote-as 65002
!
end
BA-RT1 :
conf t
!
ip access-list extended 100
1 permit tcp any any
!
router bgp 65002
bgp router-id 1.1.1.1
neighbor 100.1.3.254 remote-as 10000
!
end
A6
BA-RT1:
conf t
!
router ospf 100
network 1.1.1.1 0.0.0.0 area 0
!
router bgp 65002
network 11.11.11.11 mask 255.255.255.255
neighbor 2.2.2.2 remote-as 65002
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 route-reflector-client
neighbor 2.2.2.2 next-hop-self
neighbor 3.3.3.3 remote-as 65002
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 route-reflector-client
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 remote-as 65002
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 route-reflector-client
neighbor 4.4.4.4 next-hop-self
!
end
BA-RT2:
conf t
!
router ospf 100
network 2.2.2.2 0.0.0.0 area 0
!
router bgp 65002
network 22.22.22.22 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 65002
neighbor 1.1.1.1 update-source Loopback0
!
end
BA-RT3:
conf t
!
router ospf 100
network 3.3.3.3 0.0.0.0 area 0
!
router bgp 65002
network 33.33.33.33 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 65002
neighbor 1.1.1.1 update-source Loopback0
!
end
BA-RT4:
conf t
!
router ospf 100
network 4.4.4.4 0.0.0.0 area 1
!
router bgp 65002
network 44.44.44.44 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 65002
neighbor 1.1.1.1 update-source Loopback0
!
end
A7
HQ-RT1 :
conf t
!
access-list 10 permit 192.168.10.0 0.0.0.255
access-list 20 permit 192.168.20.0 0.0.0.255
!
route-map Set_MED permit 10
match ip address 10
set metric 100
route-map Set_MED permit 20
match ip address 20
set metric 200
!
router bgp 65001
network 192.168.10.0 mask 255.255.255.0
network 192.168.20.0 mask 255.255.255.0
neighbor 100.1.1.254 route-map Set_MED out
!
end
HQ-RT2:
conf t
!
access-list 10 permit 192.168.10.0 0.0.0.255
access-list 20 permit 192.168.20.0 0.0.0.255
!
route-map Set_MED permit 10
match ip address 10
set metric 200
route-map Set_MED permit 20
match ip address 20
set metric 100
!
router bgp 65001
network 192.168.10.0 mask 255.255.255.0
network 192.168.20.0 mask 255.255.255.0
neighbor 100.1.2.254 route-map Set_MED out
!
end
BA-RT1:
conf t
!
ip access-list extended 100
2 permit udp any any
!
route-map BtoO deny 10
match interface Loopback1
route-map BtoO permit 100
!
router bgp 65002
redistribute ospf 100
!
router ospf 100
redistribute bgp 65002 subnets route-map BtoO
!
end
A8
上記の通り Config を実施すれば、期待された出力を得ることが可能。
関連コンテンツ