實(shí)驗(yàn)拓?fù)?/strong> 實(shí)驗(yàn)需求 1、C1與C3屬于VLAN10,,C2與C4屬于VLAN20,,在SW1上創(chuàng)建VLAN100做上行VLAN 2、在SW1上終結(jié)所有VLAN 3,、在所有VLAN成員使用DHCP獲取IP 4、全網(wǎng)互通 IP規(guī)劃 VLAN10 :192.168.10.0/24 VLAN20 :192.168.20.0/24 VLAN100:192.168.100.10/24 R1 G0/0/0:192.168.100.1/24 SW1配置: <SW1>system-view //進(jìn)入系統(tǒng)視圖 [SW1]vlan batch 10 20 100 //創(chuàng)建VLAN [SW1]dhcp enable //開啟DHCP服務(wù) [SW1]inter g0/0/1 [SW1-GigabitEthernet0/0/1]port hybrid pvid vlan 10 [SW1-GigabitEthernet0/0/1]port hybrid untagged vlan 10 //將接口以untagged方式加入vlan [SW1-GigabitEthernet0/0/1]int g0/0/2 [SW1-GigabitEthernet0/0/2]port hybrid pvid vlan 20 [SW1-GigabitEthernet0/0/2]port hybrid untagged vlan 20 [SW1-GigabitEthernet0/0/2]int g0/0/10 [SW1-GigabitEthernet0/0/10]port hybrid pvid vlan 100 [SW1-GigabitEthernet0/0/10]port hybrid untagged vlan 100 [SW1-GigabitEthernet0/0/10]int g0/0/24 [SW1-GigabitEthernet0/0/24]port hybrid tagged vlan 10 20 //將接口以tagged方式加入vlan [SW1-GigabitEthernet0/0/24]quit [SW1]inter vlan 10 //進(jìn)入vlan10 [SW1-Vlanif10]ip address 192.168.10.1 24 //配置vlan10成員的網(wǎng)關(guān) [SW1-Vlanif10]dhcp select interface //將dhcp應(yīng)用在接口 [SW1-Vlanif10]int vlan 20 [SW1-Vlanif20]ip address 192.168.20.1 24 [SW1-Vlanif20]dhcp select interface [SW1-Vlanif20]int vlan 100 [SW1-Vlanif100]ip address 192.168.100.10 24 SW2配置: <SW2>system-view [SW2]vlan batch 10 20 [SW2]inter g0/0/1 [SW2-GigabitEthernet0/0/1]port hybrid pvid vlan 10 [SW2-GigabitEthernet0/0/1]port hybrid untagged vlan 10 [SW2-GigabitEthernet0/0/1]int g0/0/2 [SW2-GigabitEthernet0/0/2]port hybrid pvid vlan 20 [SW2-GigabitEthernet0/0/2]port hybrid untagged vlan 20 [SW2-GigabitEthernet0/0/2]int g0/0/24 [SW2-GigabitEthernet0/0/24]port hybrid tagged vlan 10 20 R1配置: <R1>system-view [R1]ip route-static 0.0.0.0 0.0.0.0 192.168.100.10 [R1]inter G0/0/0 [R1-GigabitEthernet0/0/0]ip address 192.168.100.1 24 測試:
|
|