網(wǎng) 工 圈 有網(wǎng)友,遇到一個(gè)案例,不會(huì)配,私信:龍哥 安排! 題目如下:
PC1的配置: 建議正式配置前,把每臺(tái)網(wǎng)絡(luò)設(shè)備的設(shè)備名修改一下,防止后續(xù)配錯(cuò)設(shè)備了。 題目說(shuō),創(chuàng)建VLAN可以使用GVRP來(lái)創(chuàng)建。 SW2配置 [SW2]gvrp [SW2]int Eth0/0/1 [SW2-Ethernet0/0/1]port link-type trunk [SW2-Ethernet0/0/1]port trunk allow-pass vlan all [SW2-Ethernet0/0/2]gvrp [SW2-Ethernet0/0/1]qu [SW2] [SW2]int e0/0/2 [SW2-Ethernet0/0/2]port link-type trunk [SW2-Ethernet0/0/2]port trunk allow-pass vlan all [SW2-Ethernet0/0/2]gvrp [SW2-Ethernet0/0/2]qu [SW2] SW1配置: [SW1]gvrp [SW1]int Eth0/0/4 [SW1-Ethernet0/0/4]port link-type trunk [SW1-Ethernet0/0/4]port trunk allow-pass vlan all [SW1-Ethernet0/0/4]gvrp [SW1-Ethernet0/0/4]qu [SW1] [SW1]int Eth0/0/5 [SW1-Ethernet0/0/5]port link-type trunk [SW1-Ethernet0/0/5]port trunk allow-pass vlan all [SW1-Ethernet0/0/5]gvrp [SW1-Ethernet0/0/5]qu [SW1] 現(xiàn)在我們必須在SW1創(chuàng)建vlan 41、51,然后再來(lái)看看SW2是否也自動(dòng)創(chuàng)建了: [SW1]vlan 41 [SW1-vlan41]qu [SW1] [SW1]vlan 51 [SW1-vlan51]qu [SW1] 同理,SW6、SW7、SW8也這樣配置: SW6的配置: [SW6]gvrp [SW6]int Eth0/0/2 [SW6-Ethernet0/0/2]port link-type trunk [SW6-Ethernet0/0/2]port trunk allow-pass vlan all [SW6-Ethernet0/0/2]gvrp [SW6-Ethernet0/0/2]qu [SW6] [SW6]int Eth0/0/3 [SW6-Ethernet0/0/3]port link-type trunk [SW6-Ethernet0/0/3]port trunk allow-pass vlan all [SW6-Ethernet0/0/3]gvrp [SW6-Ethernet0/0/3]qu [SW6] SW7的配置: [SW7]gvrp [SW7]int Eth0/0/1 [SW7-Ethernet0/0/1]port link-type trunk [SW7-Ethernet0/0/1]port trunk allow-pass vlan all [SW7-Ethernet0/0/1]gvrp [SW7-Ethernet0/0/1]qu [SW7] [SW7]int Eth0/0/2 [SW7-Ethernet0/0/2]port link-type trunk [SW7-Ethernet0/0/2]port trunk allow-pass vlan all [SW7-Ethernet0/0/2]gvrp [SW7-Ethernet0/0/2]qu [SW7] SW8的配置: [SW8]gvrp [SW8]int Eth0/0/1 [SW8-Ethernet0/0/1]port link-type trunk [SW8-Ethernet0/0/1]port trunk allow-pass vlan all [SW8-Ethernet0/0/1]gvrp [SW8-Ethernet0/0/1]qu [SW8] [SW8]int Eth0/0/2 [SW8-Ethernet0/0/2]port link-type trunk [SW8-Ethernet0/0/2]port trunk allow-pass vlan all [SW8-Ethernet0/0/2]gvrp [SW8-Ethernet0/0/2]qu [SW8] 在SW8創(chuàng)建VLAN: [SW8]vlan 61 [SW8-vlan61]qu [SW8] [SW8]vlan 71 [SW8-vlan71]qu [SW8] VLAN確定后,我們就可以根據(jù)拓?fù)鋱D,給每個(gè)PC所接的交換機(jī)端口劃分VLAN了。 [SW1]int e0/0/2 [SW1-Ethernet0/0/2]port link-type access [SW1-Ethernet0/0/2]port default vlan 41 [SW1-Ethernet0/0/2]stp edged-port enable [SW1] [SW1]int e0/0/6 [SW1-Ethernet0/0/6]port link-type access [SW1-Ethernet0/0/6]port default vlan 41 [SW1-Ethernet0/0/6]stp edged-port enable [SW1] [SW1]int e0/0/3 [SW1-Ethernet0/0/3]port link-type access [SW1-Ethernet0/0/3]port default vlan 51 [SW1-Ethernet0/0/3]stp edged-port enable [SW1] [SW8]int e0/0/3 [SW8-Ethernet0/0/3]port link-type access [SW8-Ethernet0/0/3]port default vlan 61 [SW8-Ethernet0/0/3]stp edged-port enable [SW8] [SW8]int e0/0/5 [SW8-Ethernet0/0/5]port link-type access [SW8-Ethernet0/0/5]port default vlan 61 [SW8-Ethernet0/0/5]stp edged-port enable [SW8] [SW8]int e0/0/4 [SW8-Ethernet0/0/4]port link-type access [SW8-Ethernet0/0/4]port default vlan 71 [SW8-Ethernet0/0/4]stp edged-port enable [SW8] 即在R1上做單臂路由。 在SW2上連接路由器的接口配置成trunk: [SW2]int Eth0/0/3 [SW2-Ethernet0/0/3]port link-type trunk [SW2-Ethernet0/0/3]port trunk allow-pass vlan all [SW2-Ethernet0/0/3]gvrp R1上的配置: [R1]int g0/0/0.1 [R1-GigabitEthernet0/0/0.2]ip address 192.3.41.150 26 [R1-GigabitEthernet0/0/0.2]dot1q termination vid 41 [R1]int g0/0/0.2 [R1-GigabitEthernet0/0/0.2]ip address 192.3.51.150 26 [R1-GigabitEthernet0/0/0.2]dot1q termination vid 51 現(xiàn)在我們來(lái)驗(yàn)證一下,vlan間的通信: 即在R4上做單臂路由。 在SW6上連接路由器的接口配置成trunk: [SW6]int Eth0/0/1 [SW6-Ethernet0/0/1]port link-type trunk [SW6-Ethernet0/0/1]port trunk allow-pass vlan all [SW6-Ethernet0/0/1]gvrp R4上的配置: [R4]int g0/0/1.1 [R4-GigabitEthernet0/0/1.1]ip address 192.3.61.100 24 [R4-GigabitEthernet0/0/1.1]dot1q termination vid 61 [R4]int g0/0/1.2 [R1-GigabitEthernet0/0/1.2]ip address 192.3.71.100 24 [R1-GigabitEthernet0/0/1.2]dot1q termination vid 71 現(xiàn)在我們來(lái)驗(yàn)證一下,vlan間的通信: 由于華為默認(rèn)是MSTP,所以我們需要修改一下,改為STP,再來(lái)看看STP狀態(tài): 把SW2修改為STP,并修改優(yōu)先級(jí),使之成為根橋 [SW2]stp mode stp [SW2]stp priority 0 現(xiàn)在我們來(lái)看STP狀態(tài): SW2: [SW6]stp region-configuration [SW6-mst-region]region-name along [SW6-mst-region]instance 1 vlan 61 [SW6-mst-region]instance 2 vlan 71 [SW6-mst-region]active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. [SW6-mst-region]qu [SW6]stp instance 1 root primary //把vlan61在SW6設(shè)置為根橋 [SW6]stp instance 2 root secondary //把vlan71在SW6設(shè)置為次根橋 [SW6] [SW7]stp region-configuration [SW7-mst-region]region-name along [SW7-mst-region]instance 1 vlan 61 [SW7-mst-region]instance 2 vlan 71 [SW7-mst-region]active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. [SW7-mst-region]qu [SW7]stp instance 1 root secondary //把vlan61在SW7設(shè)置為次根橋 [SW7]stp instance 2 root primary //把vlan71在SW7設(shè)置為根橋 [SW7] [R4]int g0/0/1 [R4-GigabitEthernet0/0/0]ip add 14.1.1.1 24 [R4]int g0/0/0 [R4-GigabitEthernet0/0/0]ip add 14.1.1.4 24 1、靜態(tài)路由: [R1]ip route-static 192.3.61.0 24 14.1.1.4 [R1]ip route-static 192.3.71.0 24 14.1.1.4 [R1] [R4]ip route-static 192.3.41.0 26 14.1.1.1 [R4]ip route-static 192.3.51.0 26 14.1.1.1 [R4] 接下來(lái)驗(yàn)證一下: PC1可以ping通 PC4 PC1可以ping通 PC3: 2、RIPv2配置: a、先刪除上述靜態(tài)路由; [R1]undo ip route-static 192.3.61.0 24 14.1.1.4 [R1]undo ip route-static 192.3.71.0 24 14.1.1.4 [R1] [R4]undo ip route-static 192.3.41.0 26 14.1.1.1 [R4]undo ip route-static 192.3.51.0 26 14.1.1.1 [R4] b、配置RIPv2 在R1上配置ripv2 [R1]rip [R1-rip-1]version 2 [R1-rip-1]network 192.3.41.0 [R1-rip-1]network 192.3.51.0 [R1-rip-1]net 14.0.0.0 [R1-rip-1] 在R2上配置ripv2 [R4]rip [R4-rip-1]version 2 [R4-rip-1]network 192.3.61.0 [R4-rip-1]network 192.3.71.0 [R4-rip-1]net 14.0.0.0 [R4-rip-1] 接下來(lái)驗(yàn)證一下: 3、單區(qū)域OSPF a、刪除ripv2 [R1]undo rip 1 Warning: The RIP process will be deleted. Continue?[Y/N]y [R1] [R4]undo rip 1 Warning: The RIP process will be deleted. Continue?[Y/N]y [R1] b、配置ospf [R1]ospf [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]net 14.1.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]net 192.3.41.150 0.0.0.0 [R1-ospf-1-area-0.0.0.0]net 192.3.51.150 0.0.0.0 [R1-ospf-1-area-0.0.0.0] [R1-ospf-1-area-0.0.0.0]qu [R1-ospf-1] [R4]ospf [R4-ospf-1]area 0 [R4-ospf-1-area-0.0.0.0]net 14.1.1.4 0.0.0.0 [R4-ospf-1-area-0.0.0.0]net 192.3.61.100 0.0.0.0 [R4-ospf-1-area-0.0.0.0]net 192.3.71.100 0.0.0.0 [R4-ospf-1-area-0.0.0.0]qu [R4-ospf-1] 驗(yàn)證,這次換PC2 ping PC3、 PC4: 配置之前,我們先看看PC1能不能訪(fǎng)問(wèn)PC3、PC6: 看看PC5能不能訪(fǎng)問(wèn)PC3、PC6: 現(xiàn)在我們來(lái)使用高級(jí)ACL 來(lái)滿(mǎn)足需求: 配置ACL [R1]acl number 3001 [R1-acl-adv-3001]rule 5 deny ip source 192.3.41.129 0 destination 192.3.61.3 0 配置流分類(lèi): [R1]traffic classifier tc [R1-classifier-tc]if-match acl 3001 [R1-classifier-tc]qu 配置流行為: [R1]traffic behavior tb [R1-behavior-tb]deny [R1-behavior-tb]qu 配置流策略: [R1]traffic policy tp [R1-trafficpolicy-tp]classifier tc behavior tb [R1-trafficpolicy-tp]qu 應(yīng)用到接口: [R1]int g0/0/0.1 [R1-GigabitEthernet0/0/0.1]traffic-policy tp inbound [R1-GigabitEthernet0/0/0.1]qu [R1]int GigabitEthernet 0/0/0.2 [R1-GigabitEthernet0/0/0.2]traffic-policy tp inbound [R1-GigabitEthernet0/0/0.2]qu 現(xiàn)在我們來(lái)驗(yàn)證看看,PC1不能訪(fǎng)問(wèn)PC3,但是可以訪(fǎng)問(wèn)PC6,PC5可以訪(fǎng)問(wèn)PC3和PC6: 到這里就完成了,最后記得保存設(shè)備配置喔! 每臺(tái)設(shè)備執(zhí)行 save 命令,選擇Y,再回車(chē)。 |
|
來(lái)自: 網(wǎng)絡(luò)工程師阿龍 > 《待分類(lèi)》