一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

華為三層交換機(jī)配置不同網(wǎng)段互通

 啟云_9137 2022-01-07

寫在前面


  • 問答平臺(tái)看到這樣一個(gè)問題,回答后所以順便整理一下
  • 一般情況下,三層交換機(jī)不直接連終端,太浪費(fèi)了,可以連一個(gè)交換機(jī)然后再連終端

傍晚時(shí)分,你坐在屋檐下,看著天慢慢地黑下去,心里寂寞而凄涼,感到自己的生命被剝奪了。當(dāng)時(shí)我是個(gè)年輕人,但我害怕這樣生活下去,衰老下去。在我看來,這是比死亡更可怕的事。--------王小波


案例

需求:實(shí)驗(yàn)室有一條接入網(wǎng)線,該網(wǎng)線直接連接PC,PC的IP設(shè)置為 192.168.100.xxx 后可以訪問服務(wù)器機(jī)房的服務(wù)器(IP為192.168.100.1),但是想要實(shí)驗(yàn)室內(nèi)的多臺(tái)PC都能訪問 192.168.100.1,請(qǐng)問交換機(jī)應(yīng)該如何配置?

拓?fù)鋱D

設(shè)計(jì)拓?fù)鋱D

拓?fù)鋱D。配置

文章圖片1

配置三層交換機(jī)

配置終端IP

ping測(cè)試

配置

配置三層交換機(jī)

在三層交換機(jī)LSW上創(chuàng)建VLAN

Please press enter to start cmd line!<Huawei>syst <Huawei>system-view Enter system view, return user view with Ctrl+Z.[Huawei]vlan batch 100 10Info: This operation may take a few seconds. Please wait for a moment...done.[Huawei]Oct 16 2021 14:06:41-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 4, the change loop count is 0, and the maximum number of records is 4095.[Huawei]quit<Huawei>undo terminal debuggingInfo: Current terminal debugging is off.<Huawei>undo terminal monitorInfo: Current terminal monitor is off.<Huawei>undo terminal loggingInfo: Current terminal logging is off.<Huawei>undo terminal trappingInfo: Current terminal trapping is off.

將接口加入到對(duì)應(yīng)VLAN中

<Huawei>system-view Enter system view, return user view with Ctrl+Z.[Huawei]interface GigabitEthernet 0/0/1[Huawei-GigabitEthernet0/0/1]port link-type access[Huawei-GigabitEthernet0/0/1]port default vlan 100[Huawei-GigabitEthernet0/0/1]quit[Huawei]port-group 2[Huawei-port-group-2]group-member GigabitEthernet 0/0/2 GigabitEthernet 0/0/3 [Huawei-port-group-2]port link-type access[Huawei-GigabitEthernet0/0/2]port link-type access[Huawei-GigabitEthernet0/0/3]port link-type access[Huawei-port-group-2]port default vlan 10[Huawei-GigabitEthernet0/0/2]port default vlan 10[Huawei-GigabitEthernet0/0/3]port default vlan 10[Huawei-port-group-2]quit

在三層交換機(jī)上給VLAN配置網(wǎng)關(guān)

[Huawei]interface Vlanif 100[Huawei-Vlanif100]ip address 192.168.100.254 24[Huawei-Vlanif100]quit[Huawei]interface Vlanif 10[Huawei-Vlanif10]ip address 192.168.10.254 24[Huawei-Vlanif10]quit[Huawei]display ip routing-table | include /24Route Flags: R - relay, D - download to fib------------------------------------------------------------------------------Routing Tables: Public Destinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface 192.168.10.0/24 Direct 0 0 D 192.168.10.254 Vlanif10 192.168.100.0/24 Direct 0 0 D 192.168.100.254 Vlanif100[Huawei]

配置終端

文章圖片2

服務(wù)器

PC>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fea0:1eb4IPv6 address......................: :: / 128IPv6 gateway......................: ::IPv4 address......................: 192.168.100.1Subnet mask.......................: 255.255.255.0Gateway...........................: 192.168.100.254Physical address..................: 54-89-98-A0-1E-B4DNS server........................:PC>ping 192.168.10.2Ping 192.168.10.2: 32 data bytes, Press Ctrl_C to breakFrom 192.168.10.2: bytes=32 seq=1 ttl=127 time=110 msFrom 192.168.10.2: bytes=32 seq=2 ttl=127 time=47 msFrom 192.168.10.2: bytes=32 seq=3 ttl=127 time=46 ms--- 192.168.10.2 ping statistics ---  3 packet(s) transmitted  3 packet(s) received  0.00% packet loss  round-trip min/avg/max = 46/67/110 ms

PC1

Welcome to use PC Simulator!PC>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fea7:1ca1IPv6 address......................: :: / 128IPv6 gateway......................: ::IPv4 address......................: 192.168.10.2Subnet mask.......................: 255.255.255.0Gateway...........................: 192.168.10.254Physical address..................: 54-89-98-A7-1C-A1DNS server........................:PC>ping 192.168.100.1Ping 192.168.100.1: 32 data bytes, Press Ctrl_C to breakFrom 192.168.100.1: bytes=32 seq=1 ttl=127 time=47 msFrom 192.168.100.1: bytes=32 seq=2 ttl=127 time=31 ms--- 192.168.100.1 ping statistics --- 2 packet(s) transmitted 2 packet(s) received 0.00% packet loss round-trip min/avg/max = 31/39/47 ms

PC2

PC>ipconfigLink local IPv6 address...........: fe80::5689:98ff:fe84:2ce2IPv6 address......................: :: / 128IPv6 gateway......................: ::IPv4 address......................: 192.168.10.3Subnet mask.......................: 255.255.255.0Gateway...........................: 192.168.10.254Physical address..................: 54-89-98-84-2C-E2DNS server........................:PC>ping 192.168.100.1Ping 192.168.100.1: 32 data bytes, Press Ctrl_C to breakRequest timeout!From 192.168.100.1: bytes=32 seq=2 ttl=127 time=47 msFrom 192.168.100.1: bytes=32 seq=3 ttl=127 time=47 msFrom 192.168.100.1: bytes=32 seq=4 ttl=127 time=47 ms--- 192.168.100.1 ping statistics ---  4 packet(s) transmitted  3 packet(s) received  25.00% packet loss  round-trip min/avg/max = 0/47/47 ms

一般的解決方案

綜合組網(wǎng)

案例(更合理地使用三層交換機(jī)):交換機(jī)、三層交換機(jī)、路由構(gòu)建網(wǎng)絡(luò)

需求:實(shí)驗(yàn)室有一條接入網(wǎng)線,該網(wǎng)線直接連接PC,PC的IP設(shè)置為 192.168.4.xxx 后可以訪問服務(wù)器機(jī)房的服務(wù)器(IP為192.168.5.1),但是想要實(shí)驗(yàn)室內(nèi)的多臺(tái)PC都能訪問 192.168.5.1,請(qǐng)問交換機(jī)應(yīng)該如何配置?

綜合組網(wǎng)

第一步:設(shè)計(jì)好網(wǎng)絡(luò)拓?fù)浣Y(jié)構(gòu);為了緩解三層交換機(jī)的壓力,通常連接外部網(wǎng)路需要連接一個(gè)路由器。路由器的功能要比三成交換機(jī)強(qiáng)大。

文章圖片3
  • 第二步:在PC1、PC2 和 PC3 及PC4 中配置IP地址,子網(wǎng)掩碼和網(wǎng)關(guān);
PC1: IP地址:192.168.1.1/24 網(wǎng)關(guān):192.168.1.254PC2: IP地址:192.168.2.1/24 網(wǎng)關(guān):192.168.2.254PC3: IP地址:192.168.3.1/24 網(wǎng)關(guān):192.168.3.254PC4: IP地址:192.168.5.1/24 網(wǎng)關(guān):192.168.5.254
  • 第三步:在二層交換機(jī) (S3700) LSW1上創(chuàng)建VLAN;
<LSW1>system-view[LSW1]vlan batch 2 to 3 #二層交換機(jī)上創(chuàng)建vlan
  • 第四步:將接口加入到交換機(jī) (S3700) LSW1相應(yīng)的vlan中;
[LSW1]interface Ethernet 0/0/2[LSW1-Ethernet0/0/2]port link-type access[LSW1-Ethernet0/0/2]port default vlan 2[LSW1-Ethernet0/0/2]display vlan #查看結(jié)果[LSW1]interface Ethernet 0/0/3[LSW1-Ethernet0/0/3]port link-type access[LSW1-Ethernet0/0/3]port default vlan 3[LSW1-Ethernet0/0/3]display vlan #查看結(jié)果
  • 第五步:在二層交換機(jī)LSW1 (S3700) 和三層交換機(jī)LSW2(S5700) 上配置trunk(中繼鏈路)
#在二層交換機(jī)LSW1 (S3700)的Ethernet 0/0/4接口配置trunk[LSW1]interface Ethernet 0/0/4[LSW1-Ethernet0/0/4]port link-type trunk[LSW1-Ethernet0/0/4]port trunk allow-pass vlan all[LSW1-Ethernet0/0/4]quit[LSW1]display current-configuration#在三層交換機(jī)LSW2(S5700)的Ethernet 0/0/4接口配置trunk[LSW2]interface GigabitEthernet 0/0/1[LSW2-GigabitEthernet0/0/1]port link-type trunk[LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan all[LSW2-GigabitEthernet0/0/1]quit[LSW2]display current-configuration
  • 第六步:在三層交換機(jī)LSW2(S5700)上創(chuàng)建vlan,并將接口GE 0/0/2加入到vlan 4中
<LSW2>system-view[LSW2]vlan batch 2 to 4 #三層交換機(jī)上創(chuàng)建vlan[LSW2]interface GigabitEthernet 0/0/2[LSW2-GigabitEthernet0/0/2]port link-type access[LSW2-GigabitEthernet0/0/2]port default vlan 4[LSW2-GigabitEthernet0/0/2]display vlan #查看結(jié)果
  • 第七步:在三層交換機(jī) LSW2(S5700) 的虛接口上配置IP
#在vlan 1上配置IP地址[LSW2]interface Vlanif 1[LSW2-Vlanif1]ip address 192.168.1.254 24[LSW2-Vlanif1]quit#在vlan 2上配置IP地址[LSW2]interface Vlanif 2[LSW2-Vlanif2]ip address 192.168.2.254 24[LSW2-Vlanif2]quit#在vlan 3上配置IP地址[LSW2]interface Vlanif 3[LSW2-Vlanif3]ip address 192.168.3.254 24[LSW2-Vlanif3]quit#在vlan 4上配置IP地址[LSW2]interface Vlanif 4[LSW2-Vlanif4]ip address 192.168.4.1 24[LSW2-Vlanif4]quit[LSW2]display ip routing-table | include /24 #查看虛接口配置信息
  • 第八步:在路由器AR1(AR2220) 上給接口配置IP地址
<AR1>system-view[AR1]interface GigabitEthernet 0/0/0[AR1-GigabitEthernet0/0/0]ip address 192.168.4.2 24[AR1]interface GigabitEthernet 0/0/1[AR1-GigabitEthernet0/0/1]ip address 192.168.5.254 24 #在路由器上給5.0網(wǎng)段配置網(wǎng)關(guān)[AR1]display ip routing-table | include /24 #查看接口IP地址配置信息
  • 第九步:在三層交換機(jī)LSW2(S5700)上配置靜態(tài)路由
<LSW2>system-view[LSW2]ip route-static 192.168.5.0 24 192.168.4.2 #目標(biāo)網(wǎng)段,子網(wǎng)掩碼,下一跳地址[LSW2]display ip routing-table | include /24
  • 第十步:在路由器AR1(AR2220) 上配置靜態(tài)路由
<AR1>system-view[AR1]ip route-static 192.168.1.0 24 192.168.4.1 #目標(biāo)網(wǎng)段,子網(wǎng)掩碼,下一跳地址[AR1]ip route-static 192.168.2.0 24 192.168.4.1[AR1]ip route-static 192.168.3.0 24 192.168.4.1[AR1]display ip routing-table | include /24
  • 第十一步:測(cè)試,保持全網(wǎng)互通

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多

    国产色偷丝袜麻豆亚洲| 国产午夜福利一区二区| 日韩三级黄色大片免费观看| 久久99青青精品免费| 日韩一区二区三区四区乱码视频| 久久热在线免费视频精品| 日本高清一道一二三区四五区| 内射精品欧美一区二区三区久久久| 国产精品午夜视频免费观看| 麻豆剧果冻传媒一二三区| 国产原创激情一区二区三区| 91免费精品国自产拍偷拍| 99秋霞在线观看视频| 色一情一乱一区二区三区码| 成人精品欧美一级乱黄| 亚洲日本加勒比在线播放| 99在线视频精品免费播放| 丝袜破了有美女肉体免费观看| 亚洲a码一区二区三区| 午夜福利视频日本一区| 久久机热频这里只精品| 搡老熟女老女人一区二区| 国产欧美高清精品一区| 美女被后入视频在线观看| 妻子的新妈妈中文字幕| 欧美一区二区黑人在线| 国产亚洲欧美日韩国亚语| 亚洲国产成人精品一区刚刚| 成年女人下边潮喷毛片免费| 出差被公高潮久久中文字幕| 国产精品午夜福利在线观看| 好吊一区二区三区在线看| 日韩欧美中文字幕av| 日韩日韩日韩日韩在线| 亚洲黑人精品一区二区欧美| 国产综合香蕉五月婷在线| 午夜国产福利在线播放| 在线观看国产午夜福利| 91在线爽的少妇嗷嗷叫| 伊人久久五月天综合网| 九九热这里有精品20|