20201223 cisco 單臂路由
Last updated
Last updated
單臂路由器:是指與網路有單一物理或邏輯連接的路由器。
它通常用於在本地連接的主機之間轉發獨立邏輯路由域上的流量,或者方便路由表的管理、分發和中繼。
int e0/0
no shut
int e0/0.10
encapsulation dot1Q 10
ip add 192.168.10.254 255.255.255.0
no shut
int e0/0.20
encapsulation dot1Q 20
ip add 192.168.20.254 255.255.255.0
no shut
do sh run
int e0/1
switchport mode access
switchport access vlan 10
int e0/2
switchport mode access
switchport access vlan 20
do sh vlan brief
int e0/0
ip addr 192.168.1.1 255.255.255.0
no shut
router ospf 1
net 192.168.1.0 0.0.0.255 area 0
ping 192.168.2.1
int e0/0
ip addr 192.168.2.1 255.255.255.0
no shut
router ospf 1
net 192.168.2.0 0.0.0.255 area 0
int e0/0
ip addr 192.168.3.1 255.255.255.0
no shut
router ospf 1
net 192.168.3.0 0.0.0.255 area 0
int e0/0
ip addr 192.168.4.1 255.255.255.0
no shut
router ospf 1
net 192.168.4.0 0.0.0.255 area 0
ip vrf Upper
ip vrf Lower
int e0/0
ip vrf forwarding Upper
ip addr 192.168.1.2 255.255.255.0
no shut
int e0/1
ip vrf forwarding Lower
ip addr 192.168.3.2 255.255.255.0
no shut
int e0/2
no shut
int e0/2.10
ip vrf for Upper
encapsulation dot1Q 10
ip addr 56.1.1.1 255.255.255.0
int e0/2.20
ip vrf for Lower
encapsulation dot1Q 20
ip addr 56.3.3.3 255.255.255.0
do sh ip vrf
do sh ip route vrf Upper
do sh ip route vrf Lower
router ospf 1 vrf Upper
net 192.168.1.0 0.0.0.255 area 0
net 56.1.1.0 0.0.0.255 area 0
router ospf 2 vrf Lower
net 192.168.3.0 0.0.0.255 area 0
net 56.3.3.0 0.0.0.255 area 0
ip vrf Upper
ip vrf Lower
int e0/0
ip vrf forwarding Upper
ip addr 192.168.2.2 255.255.255.0
no shut
int e0/1
ip vrf forwarding Lower
ip addr 192.168.4.2 255.255.255.0
no shut
int e0/2
no shut
int e0/2.10
ip vrf for Upper
encapsulation dot1Q 10
ip addr 56.1.1.2 255.255.255.0
int e0/2.20
ip vrf for Lower
encapsulation dot1Q 20
ip addr 56.3.3.4 255.255.255.0
do sh ip vrf
do sh ip route vrf Upper
do sh ip route vrf Lower
router ospf 1 vrf Upper
net 192.168.2.0 0.0.0.255 area 0
net 56.1.1.0 0.0.0.255 area 0
router ospf 2 vrf Lower
net 192.168.4.0 0.0.0.255 area 0
net 56.3.3.0 0.0.0.255 area 0