企业网络组建项目实训--交换机的配置与管理(下)
任務四?三層交換機實現不同VLAN間互訪
? ? ? ?信科上海分公司的財務部和客服部位于同一樓層,兩個部門被劃分在不同VLAN中,現在想通過三層交換機使這兩個部門實現通信,網絡拓撲圖如下圖。具體操作如下:
步驟1????規劃交換機端口、VLAN及計算機IP地址,如上圖文字所示。?
步驟2??開啟路由功能并劃分VLAN10及VLAN20,分別加入端口f0/1和f0/2,代碼如下:
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# Switch(config)#ip routing //啟動路由功能 Switch(config)#vlan 10 Switch(config-vlan)#name AD Switch(config-vlan)#ex Switch(config)#vlan 20 Switch(config-vlan)#name FD Switch(config-vlan)#ex Switch(config)#int f0/1 Switch(config-if)#switch access vlan 10 Switch(config-if)#ex Switch(config)#int f0/2 Switch(config-if)#switch access vlan 20 Switch(config-if)#ex步驟3??為VLAN10及VLAN20設置IP地址,代碼如下:?
Switch(config)#int vlan 10 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upSwitch(config-if)#ip address 192.168.10.1 255.255.255.0 //設置vlan的ip地址 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#int vlan 20 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan20, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upSwitch(config-if)#ip address 192.168.20.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#ex Switch#步驟3??驗證互通性?
任務五?交換機的RIP動態路由配置
? ? ? ?當兩臺以上三層交換機級聯時,為了使各交換機上連接的不同網段之間能夠互相通信,就需要配置動態路由協議。常見的動態路由協議有RIP、OSPF等。本任務通過實現信科總部不同樓層之間的相互通信,介紹交換機的RIP動態路由配置。網絡拓撲圖如圖所示。?
?
步驟1??在交換機S0和交換機S1上分別劃分基于端口的VLAN?
步驟2??配置交換機S0和S1各VLAN接口的IP地址?
步驟3???設定PC1~PC4的網絡位置及IP地址?
步驟4???配置交換機S0,代碼如下:?
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10 Switch(config-vlan)#ex Switch(config)#vlan 20 Switch(config-vlan)#ex Switch(config)#vlan 100 Switch(config-vlan)#ex Switch(config)#int f0/1 Switch(config-if)#switch access vlan 10 Switch(config-if)#ex Switch(config)#int f0/2 Switch(config-if)#switch access vlan 20 Switch(config-if)#int f0/24 Switch(config-if)#switch access vlan 100 Switch(config-if)#ex Switch(config)#int vlan 10 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upSwitch(config-if)#ip add 192.168.10.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#int vlan 20 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan20, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upSwitch(config-if)#ip add 192.168.20.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#int vlan 100 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan100, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan100, changed state to upSwitch(config-if)#ip add 192.168.100.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#ip routing Switch(config)#步驟5???配置交換機S1,代碼如下:?
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 30 Switch(config-vlan)#ex Switch(config)#vlan 40 Switch(config-vlan)#ex Switch(config)#vlan 200 Switch(config-vlan)#ex Switch(config)#int f0/1 Switch(config-if)#switch access vlan 30 Switch(config-if)#ex Switch(config)#int f0/2 Switch(config-if)#switch access vlan 40 Switch(config-if)#ex Switch(config)#int f0/24 Switch(config-if)#switch access vlan 200 Switch(config-if)#ex Switch(config)#int vlan 30 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan30, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to upSwitch(config-if)#ip add 192.168.30.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#int vlan 40 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan40, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan40, changed state to upSwitch(config-if)#ip add 192.168.40.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#int vlan 200 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan200, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan200, changed state to upSwitch(config-if)#ip add 192.168.100.2 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#ex Switch(config)#ip routing Switch(config)#?
?步驟6???通過Ping命令驗證互通性
?
步驟7???在S0上添加直連網段的動態路由協議RIP?
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#router rip Switch(config-router)#network 192.168.10.0 Switch(config-router)#network 192.168.20.0 Switch(config-router)#network 192.168.100.0 Switch(config-router)#ex步驟8??在S1上添加直連網段的動態路由協議RIP,代碼如下?
Switch(config)#router rip Switch(config-router)#network 192.168.30.0 Switch(config-router)#network 192.168.40.0 Switch(config-router)#network 192.168.100.0 Switch(config-router)#ex步驟9???通過Ping命令驗證互通性?
?
任務六?交換機間OSPF動態路由配置
? ? ? ? 本任務通過利用OSPF協議實現信科公司不同樓層之間的相互通信,介紹交換機的OSPF動態路由配置,網絡拓撲圖如下圖。
步驟1???參照本項目任務五步驟1~6,配置交換機S1、S2和PC1、PC2、PC3、PC4,并通過Ping命令驗證互通性。?
?步驟2???在S0上啟動OSPF協議,并將對應的直連網段配置到OSPF進程中,代碼如下:
Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#router ospf 1 Switch(config-router)#network 192.168.10.0 0.0.0.255 area 0 Switch(config-router)#network 192.168.20.0 0.0.0.255 area 0 Switch(config-router)#network 192.168.100.0 0.0.0.255 area 0 Switch(config-router)#ex Switch(config)#步驟3??在S1上啟動OSPF協議,并將對應的直連網段配置到OSPF進程中,代碼如下:?
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#router ospf 1 Switch(config-router)#network 192.168.30.0 255.255.255.0 % Incomplete command. Switch(config-router)#network 192.168.30.0 0.0.0.255 area 0 Switch(config-router)#network 192.168.40.0 0.0.0.255 area 0 Switch(config-router)#network 192.168.100.0 0.0.0.255 area 0 Switch(config-router)#ex Switch(config)#步驟4???通過Ping命令驗證互通性?
?
總結
以上是生活随笔為你收集整理的企业网络组建项目实训--交换机的配置与管理(下)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SSL 数字证书
- 下一篇: 7. 从0学ARM-GNU伪指令、代码编