組網技術 單臂路由實驗 近期實驗命令小結

2021-10-24 14:46:30 字數 2017 閱讀 6755

1、 單臂路由實驗步驟

1) 設定交換機 : 建立兩個vlan,並將介面加入vlan

3) 設定交換機 將連線路由器線路的介面設定成trunk

4) 設定路由器 啟用子介面,封裝,設定ip(解釋封裝,為什麼交換機口不需要封裝??)

2、 課堂上拿上一次作業綜合題演示單臂路由

交換機預設閘道器一定要配置!!

作用?路由器本徵vlan設定方法和交換機本徵vlan設定完全不同!

設定交換機:

switch(config)#vlan 2

switch(config-vlan)#int f0/10

switch(config-if)#switchport mode access

switch(config-if)#switchport access vlan 2

switch(config-if)#switchport mode trunk //設為中繼

設定路由器:

router(config)#int f0/0

router(config-if)#no shutdown 先開啟埠

router(config)#int f0/0.1 啟用子介面

router(config-if)#encapsulation dot1q 1 封裝,將vlan1分配給該埠

router(config-if)#ip address 192.168.1.254 255.255.255.0 設定ip位址和子網掩碼

router(config)#int f0/0.2

router(config-if)#encapsulation dot1q 2 native 子介面設定本徵vlan的方法

注意:路由器的不同介面不能連線相同的網段;交換機的不同介面可以連線相同的網段

作業裡常用到的一些命令(持續更新中):

禁用dns查詢:

switch(config)#no ip domain-lookup

設定主機名(以交換機為例):

switch(config)#hostname s1

將執行模式口令配置為class:

switch(config)#enable secret class

為控制台連線配置口令cisco:

switch(config)#line console 0

switch(config-line)#password cisco

switch(config-line)#login 沒有這一步不能啟用設定

為vty連線配置口令cisco:

switch(config)#line vty 0 15

switch(config-line)#password cisco

switch(config-line)#login

設定超時:

router(config)#line console 0

router(config-line)#exec-timeout 10 00 設定時間為1000ms

router(config-line)#exec-timeout 00 10 設定時間為10ms

router(config-line)#exec-timeout 0 0 永不超時退出

router(config)#bannner motd #welcome to the router#

啟用提供訪問的使用者埠:

switch(config)#int f0/1

switch(config-if)#no shutdown

為交換機設定預設閘道器:

switch(config)#ip default-gateway 172.17.88.1

設定交換機為根橋,並保證其具有最高優先順序:

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

組網技術 VTP實驗

vtp 是指 vlan trunk protocol 它的作用就是可以在有大量交換裝置,需要配置類似的vlan劃分的時候,簡化配置過程,使各個交換機互相學習vlan database。vtp模式 server 預設 伺服器模式,建立vlan 刪除vlan 修改vlan 始發vtp vtp 學習vtp...

單臂路由實驗

1.按圖配置pc的ip位址和閘道器位址 2.在s1交換機上建立vlan10和vlan20,分別把介面加入到vlan,並設定串列埠型別允許vlan10和20通過 3.在r1路由器上配置子介面 4.驗證網路是否連通 1.按要求配置pc的ip位址和閘道器 略 2.在s1交換機上建立vlan10和20,分別...

單臂路由實驗

按照圖示為 pc3 和 pc4 配置 ip 位址和閘道器 pc3 屬於 vlan10,pc4 屬於 vlan20,配置單臂路由實現 vlan10 和 vlan20 三層互通 pc3 和 pc4 可以互通 pc 配置 ip 位址部分略 pc3 屬於 vlan10,pc4 屬於 vlan20,配置單臂路...