Notes - Computer Network
  • 計算機網路
  • 期中
    • 20200916 Introduction
    • 20200923 Introduction Routing
    • 20200930 Introduction Router Setting
    • 20201007 Introduction DHCP
    • 20201014 Introduction IPV6
    • 20201021 cisco RIP
    • 20201104 cisco EIGRP (一)
    • 20201111 期中週
  • 期末
    • 20201118 cisco EIGRP (二)
    • 20201125 cisco EIGRP (三)
    • 20201202 cisco KDLinux
    • 20201209 cisco VRF & OSPF
    • 20201216 cisco VLAN
    • 20201223 cisco 單臂路由
    • 20201230 cisco STP
    • 20210106 cisco GRE
  • 參考資料
Powered by GitBook
On this page
  • 課堂資料
  • 課堂練習
  • 單臂路由
  • 實戰練習:VRF

Was this helpful?

  1. 期末

20201223 cisco 單臂路由

Previous20201216 cisco VLANNext20201230 cisco STP

Last updated 4 years ago

Was this helpful?

課堂資料

單臂路由器:是指與網路有單一物理或邏輯連接的路由器。

它通常用於在本地連接的主機之間轉發獨立邏輯路由域上的流量,或者方便路由表的管理、分發和中繼。

課堂練習

單臂路由

ip 192.168.10.1/24

設定 Gateway

ip 192.168.10.1 255.255.255.0 192.168.10.254
ping 192.168.10.254
ping 192.168.20.254
ping 192.168.20.1
ip 192.168.20.1/24

設定 Gateway

ip 192.168.20.1 255.255.255.0 192.168.20.254
ping 192.168.10.254
ping 192.168.20.254
ping 192.168.10.1
vlan 10
vlan 20
do sh vlan brief
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

設定 trunk 的 encapsulation

switchport trunk encapsulation dot1q
switchport mode trunk
do sh run
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
ip 192.168.10.1/24

設定 Gateway

ip 192.168.10.1 255.255.255.0 192.168.10.254
ping 192.168.10.254
ping 192.168.20.254
ping 192.168.20.1
ip 192.168.20.1/24

設定 Gateway

ip 192.168.20.1 255.255.255.0 192.168.20.254
ping 192.168.10.254
ping 192.168.20.254
ping 192.168.10.1
int vlan 10
ip add 192.168.10.254 255.255.255.0
no shut
int vlan 20
ip add 192.168.20.254 255.255.255.0
no shut
do sh ip int brief
int e0/0

設定 trunk 的 encapsulation

switchport trunk encapsulation dot1q
switchport mode trunk
exit
vtp mode server
vtp domain ccna
vlan 10
vlan 20
do sh vlan brief
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

實戰練習:VRF

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