一.配置vlan、 1.配置H3C1的vlan,及vlan查看命令??! [H3C1]display vlan [H3C1]display vlan all [H3C1]display port trunk [H3C1]display interface e0/4/3 2.配置H3C2的vlan 3,解決默認只允許vlan1通過trunk鏈路 [H3C1-Ethernet0/4/3]port trunk permit vlan all vlan間路由 1.三層交換trunk和hybrid 2.單臂路由 一.配置vlan、trunk 1.配置H3C1 [H3C1]int vlan 1 //為vlan1配置ip地址 [H3C1-Vlan-interface1]ip add 1.1.1.1 255.255.255.0 [H3C1-Vlan-interface1]un shut [H3C1]vlan 2 //創(chuàng)建vlan2 [H3C1-vlan2]q [H3C1]int vlan 2 //為vlan2配置ip地址 [H3C1-Vlan-interface2]ip add 2.2.2.2 255.255.255.0 [H3C1-Vlan-interface2]un shut [H3C1-Vlan-interface2]q [H3C1]int e0/4/3 //開啟trunk鏈路 [H3C1-Ethernet0/4/3]port link-type trunk 交換機的配置: [SW1]vlan 10 [SW1-vlan10]vlan 20 創(chuàng)建vlan 10和vlan 20 [SW1-GigabitEthernet1/0/2]port link-type access [SW1-GigabitEthernet1/0/2]port access vlan 10 端口配置到vlan 10 [SW1]int gi 1/0/3 SW1-GigabitEthernet1/0/3]port link-type access [SW1-GigabitEthernet1/0/3]port access vlan 20 端口配置到vlan 20 接入路由的端口配置:trunk [SW1]int gi 1/0/1 [SW1-GigabitEthernet1/0/1]port link-type trunk [SW1-GigabitEthernet1/0/1]port trunk permit vlan 10 20 端口模式為trunk,配置到vlan 10和vlan 20 路由器的配置: 與交換機相接的端口需要配置子端口 [R1]int gi 0/0 R1-GigabitEthernet0/0]undo shutdown 確認端口開啟 [R1]int gi 0/0.10 進入子端口 [R1-GigabitEthernet0/0.10]ip add 192.168.10.1 24 配置端口ip [R1-GigabitEthernet0/0.10]vlan-type dot1q vid 10 配置該子端口為vlan 10服務 R1-GigabitEthernet0/0.10]dis this nterface GigabitEthernet0/0.10 p address 192.168.10.1 255.255.255.0 lan-type dot1q vid 10 [R1]int gi 0/0.20 [R1-GigabitEthernet0/0.20]ip add 192.168.20.1 24 [R1-GigabitEthernet0/0.20]vlan-type dot1q vid 20 [R1-GigabitEthernet0/0.20]dis this interface GigabitEthernet0/0.20 ip address 192.168.20.1 255.255.255.0 vlan-type dot1q vid 20 # 以上 配置完以后pc1和pc2可以跨vlan通信 pc1配置 ip 192.168.10.2/24 路由 ip routing-table 0.0.0.0 0 192.168.10.1 pc2配置 ip 192.168.20.2/24 路由 ip routing-table 0.0.0.0 0 192.168.20.1 實際上三層交換機有路由功能:可以在交換機上直接配置 int vlan 10 創(chuàng)建虛擬接口并未接口配置ip ip add 192.168.10.1 24 int vlan 20 ip add 192.168.20.1 24 學習去除電腦彈窗廣告 |
|
來自: 網(wǎng)管愛好者 > 《待分類》