版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、不同vlan間的通信簡(jiǎn)單配置1單臂路由(圖)環(huán)境:一臺(tái)路由器,一臺(tái)二層交換機(jī),兩臺(tái)pc機(jī)二層交換機(jī)的配置一般模式:Switch輸入enable進(jìn)入特權(quán)模式:Switchenable輸入configure terminal進(jìn)入全局配置模式:Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z.創(chuàng)建vlan 10 和 vlan 20:Switch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)# exit進(jìn)
2、入接口配置模式:Switch(config)#interface fastEthernet 0/1把0/1變成trunk口(默認(rèn)是access口)Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#
3、exit進(jìn)入接口配置模式分別把對(duì)應(yīng)的接口,加入對(duì)應(yīng)的vlan:Switch(config)#interface fastEthernet 1/1Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10Switch(config-if)#interface fastEthernet 2/1Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20到此二層交換機(jī)配置完畢!路由器的
4、配置:RouterRouterenableRouter#configure terminal Enter configuration commands, one per line. End with CNTL/Z.Router(config)#inter fas 0/0Router(config-if)#no ip address Router(config-if)#no shutdown 注意:?jiǎn)伪勐酚傻呐渲酶附涌谝欢ㄒ猲o shutdown%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-
5、UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#int fas 0/0.10%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to upRouter(config-subif)#enca
6、psulation dot1Q 10注意:在配置ip時(shí)一定要先封裝802.1q協(xié)議Router(config-subif)#ip address 192.168.10.1 255.255.255.0Router(config-subif)#no shutdown Router(config-subif)#int fas 0/0.20%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20,
7、 changed state to upRouter(config-subif)#ip address 192.168.20.1 255.255.255.0% Configuring IP routing on a LAN subinterface is only allowed if thatsubinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,or ISL vLAN.Router(config-subif)#encapsulation dot1Q 20Router(config-subif)#ip
8、 address 192.168.20.1 255.255.255.0Router(config-subif)#no shutdown Router(config-subif)#查看路由表:Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA e
9、xternal type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is not setC 192.168.10.0/24 is di
10、rectly connected, FastEthernet0/0.10C 192.168.20.0/24 is directly connected, FastEthernet0/0.20Router#PC0的配置:ip 192.168.10.10netmask 255.255.255.0gateway 192.168.10.1PC1的配置:ip 192.168.20.20netmask 255.255.255.0gateway 192.168.20.12.使用SVI實(shí)現(xiàn)VLAN間的通信(圖)環(huán)境:一臺(tái)三層交換機(jī),兩臺(tái)pc機(jī)三層交換機(jī)的配置:Switchenable Switch#confi
11、gure terminal Enter configuration commands, one per line. End with CNTL/Z.創(chuàng)建vlan 10 20Switch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#exit配置SVI接口ipSwitch(config)#interface vlan 10%LINK-5-CHANGED: Interface Vlan10, changed state to upSwitch(config-if)#ip address 192.168.10.1 255.
12、255.255.0Switch(config-if)#no shutdown Switch(config-if)#interface vlan 20%LINK-5-CHANGED: Interface Vlan20, changed state to upSwitch(config-if)#ip address 192.168.20.1 255.255.255.0Switch(config-if)#no shutdown Switch(config-if)#exit改變接口模式并加入vlanSwitch(config)#interface fastEthernet 0/1Switch(conf
13、ig-if)#switchport mode access Switch(config-if)#switchport access vlan 10%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upSwitch(config-if)#interface fastEthernet 0/2Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20%LINEPROTO-5-UPDOWN: Lin
14、e protocol on Interface Vlan20, changed state to upSwitch(config-if)#看三層交換機(jī)的路由表:Switch#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
15、E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is not setC 192.168.10.0/24 is directly connecte
16、d, Vlan10C 192.168.20.0/24 is directly connected, Vlan20Switch#兩主機(jī)的配置與單臂路由中兩主機(jī)的配置一樣3.跨交換機(jī)實(shí)現(xiàn)VLAN間的通信(圖)環(huán)境:一臺(tái)三層交換機(jī),兩臺(tái)二層交換機(jī),兩臺(tái)pc機(jī)三層交換機(jī)的配置(SW3)SwitchenableSwitch#configure terminal Enter configuration commands, one per line. End with CNTL/Z.創(chuàng)建vlan 10 、20 并設(shè)置ipSwitch(config)#vlan 10Switch(config-vlan)#vl
17、an 20Switch(config-vlan)#exitSwitch(config)#interface vlan 10%LINK-5-CHANGED: Interface Vlan10, changed state to upSwitch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutdown Switch(config-if)#interface vlan 20%LINK-5-CHANGED: Interface Vlan20, changed state to upSwitch(conf
18、ig-if)#ip address 192.168.20.1 255.255.255.0Switch(config-if)#no shutdown Switch(config-if)#exit設(shè)置接口模式并加入相應(yīng)的vlan(注意trunk口的設(shè)置)Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#interface fastEthernet 0/1Switch(config-if)#switchport access vlan 10%LINEPRO
19、TO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to upSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport mode trunk Switch(config-if)#interface fastEthernet 0/2Switch(config-if)#switchport access vlan 20%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed s
20、tate to upSwitch#SW21的配置SwitchenableSwitch#configure terminal Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 10Switch(config-vlan)#exitSwitch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface Fast
21、Ethernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upSwitch(config-if)#interface fastEthernet 1/1Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#SW22的配置SwitchSwit
22、chenSwitch#Switch#configure terEnter configuration commands, one per line. End with CNTL/Z.Switch(config-if)#inter fas 2/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet2/1
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年合肥市檔案館公開招聘政府購買服務(wù)崗位人員備考題庫附答案詳解
- 2026年我州一地公開招聘事業(yè)單位工作人員13人備考題庫完整答案詳解
- 2026年·長(zhǎng)影集團(tuán)招聘?jìng)淇碱}庫附答案詳解
- 2026年商丘職業(yè)技術(shù)學(xué)院輕工業(yè)學(xué)院公開招聘人事代理工作人員補(bǔ)充招聘5人備考題庫及一套答案詳解
- 2026年德清縣人民調(diào)解員協(xié)會(huì)招聘工作人員備考題庫有答案詳解
- 2026年怒江州人力資源市場(chǎng)公開招聘勞務(wù)派遣人員備考題庫及1套參考答案詳解
- 2026年四川西津物流有限責(zé)任公司關(guān)于招聘銷售管理崗等崗位的備考題庫及一套答案詳解
- 2026年安泰天龍鎢鉬科技有限公司招聘?jìng)淇碱}庫及答案詳解1套
- 2026年吐魯番市消防救援支隊(duì)面向社會(huì)公開招聘政府專職消防員16人備考題庫及1套參考答案詳解
- 2026年北京醫(yī)院備考題庫中心招聘?jìng)淇碱}庫及完整答案詳解1套
- 云南師大附中2026屆高三高考適應(yīng)性月考卷(六)思想政治試卷(含答案及解析)
- 建筑安全風(fēng)險(xiǎn)辨識(shí)與防范措施
- CNG天然氣加氣站反恐應(yīng)急處置預(yù)案
- 培訓(xùn)教師合同范本
- 2026年黑龍江單招職業(yè)技能案例分析專項(xiàng)含答案健康養(yǎng)老智慧服務(wù)
- 定額〔2025〕1號(hào)文-關(guān)于發(fā)布2018版電力建設(shè)工程概預(yù)算定額2024年度價(jià)格水平調(diào)整的通知
- 高考生物學(xué)二輪復(fù)習(xí)備課素材:多變量實(shí)驗(yàn)題的類型及審答思維
- 瀝青瀝青混合料試驗(yàn)作業(yè)指導(dǎo)書
- 護(hù)理死亡病例討論總結(jié)
- 鋼板樁支護(hù)工程投標(biāo)文件(54頁)
評(píng)論
0/150
提交評(píng)論