企业网络组建项目实训--交换机的配置与管理(下)
任務(wù)四?三層交換機(jī)實(shí)現(xiàn)不同VLAN間互訪
? ? ? ?信科上海分公司的財(cái)務(wù)部和客服部位于同一樓層,兩個(gè)部門(mén)被劃分在不同VLAN中,現(xiàn)在想通過(guò)三層交換機(jī)使這兩個(gè)部門(mén)實(shí)現(xiàn)通信,網(wǎng)絡(luò)拓?fù)鋱D如下圖。具體操作如下:
步驟1????規(guī)劃交換機(jī)端口、VLAN及計(jì)算機(jī)IP地址,如上圖文字所示。?
步驟2??開(kāi)啟路由功能并劃分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 //啟動(dòng)路由功能 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設(shè)置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 //設(shè)置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??驗(yàn)證互通性?
任務(wù)五?交換機(jī)的RIP動(dòng)態(tài)路由配置
? ? ? ?當(dāng)兩臺(tái)以上三層交換機(jī)級(jí)聯(lián)時(shí),為了使各交換機(jī)上連接的不同網(wǎng)段之間能夠互相通信,就需要配置動(dòng)態(tài)路由協(xié)議。常見(jiàn)的動(dòng)態(tài)路由協(xié)議有RIP、OSPF等。本任務(wù)通過(guò)實(shí)現(xiàn)信科總部不同樓層之間的相互通信,介紹交換機(jī)的RIP動(dòng)態(tài)路由配置。網(wǎng)絡(luò)拓?fù)鋱D如圖所示。?
?
步驟1??在交換機(jī)S0和交換機(jī)S1上分別劃分基于端口的VLAN?
步驟2??配置交換機(jī)S0和S1各VLAN接口的IP地址?
步驟3???設(shè)定PC1~PC4的網(wǎng)絡(luò)位置及IP地址?
步驟4???配置交換機(jī)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???配置交換機(jī)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???通過(guò)Ping命令驗(yàn)證互通性
?
步驟7???在S0上添加直連網(wǎng)段的動(dòng)態(tài)路由協(xié)議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上添加直連網(wǎng)段的動(dòng)態(tài)路由協(xié)議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???通過(guò)Ping命令驗(yàn)證互通性?
?
任務(wù)六?交換機(jī)間OSPF動(dòng)態(tài)路由配置
? ? ? ? 本任務(wù)通過(guò)利用OSPF協(xié)議實(shí)現(xiàn)信科公司不同樓層之間的相互通信,介紹交換機(jī)的OSPF動(dòng)態(tài)路由配置,網(wǎng)絡(luò)拓?fù)鋱D如下圖。
步驟1???參照本項(xiàng)目任務(wù)五步驟1~6,配置交換機(jī)S1、S2和PC1、PC2、PC3、PC4,并通過(guò)Ping命令驗(yàn)證互通性。?
?步驟2???在S0上啟動(dòng)OSPF協(xié)議,并將對(duì)應(yīng)的直連網(wǎng)段配置到OSPF進(jìn)程中,代碼如下:
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上啟動(dòng)OSPF協(xié)議,并將對(duì)應(yīng)的直連網(wǎng)段配置到OSPF進(jìn)程中,代碼如下:?
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???通過(guò)Ping命令驗(yàn)證互通性?
?
總結(jié)
以上是生活随笔為你收集整理的企业网络组建项目实训--交换机的配置与管理(下)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SSL 数字证书
- 下一篇: 7. 从0学ARM-GNU伪指令、代码编