vlan

一、在交换机上创建vlan2与vlan3

[sw1]vlan 2
[sw1-vlan2]q
[sw1]vlan 3
[sw1-vlan3]

二、交换机上各个对应的接口划分到对应的vlan中

[sw1]interface e0/0/2  
[sw1-Ethernet0/0/2]port link-type access 
[sw1-Ethernet0/0/2]port default vlan 2

[sw1]interface e0/0/3    
[sw1-Ethernet0/0/3]port link-type access  
[sw1-Ethernet0/0/3]port default vlan 2

   
[sw1-Ethernet0/0/4]port link-type access 
[sw1-Ethernet0/0/4]port default vlan 3

 
[sw1-Ethernet0/0/5]port link-type access 
[sw1-Ethernet0/0/5]port default vlan 3
vlan_第1张图片

[sw2]vlan batch 2 to 3

[sw2-Ethernet0/0/2]port link-type access 

[sw2-Ethernet0/0/2]port default vlan 2

[sw2]interface e0/0/3
[sw2-Ethernet0/0/3]port link-type access 
[sw2-Ethernet0/0/3]port default vlan 3
 

 vlan_第2张图片

 三、trunk干道

[sw1]int e0/0/6
[sw1-Ethernet0/0/6]port link-type trunk 
[sw1-Ethernet0/0/6]port trunk allow-pass vlan 2 to 3
 

[sw2]int e0/0/4
[sw2-Ethernet0/0/4]port link-type trunk     
[sw2-Ethernet0/0/4]port trunk allow-pass vlan 2 to 3

vlan_第3张图片

四、创建子接口

[route]interface g0/0/0.1
 [route-GigabitEthernet0/0/0.1]dot1q termination vid 2
[route-GigabitEthernet0/0/0.1]ip add 192.168.1.254 24
[route-GigabitEthernet0/0/0.1]arp broadcast enable 
[route-GigabitEthernet0/0/0.1]q

[route]interface g0/0/0.2 
[route-GigabitEthernet0/0/0.2]dot1q termination vid 3
[route-GigabitEthernet0/0/0.2]ip address 192.168.2.254 24
[route-GigabitEthernet0/0/0.2]arp broadcast enable 

vlan_第4张图片


[route]dhcp enable 
[route]ip pool v2
[route-ip-pool-v2]network 192.168.1.0 mask 24
[route-ip-pool-v2]gateway-list 192.168.1.254
[route-ip-pool-v2]dns-list 114.114.114.114
[route-ip-pool-v2]q


[route]ip pool 3
[route-ip-pool-3]network 192.168.2.0 mask 24
[route-ip-pool-3]gateway-list 192.168.2.254
[route-ip-pool-3]dns-list 114.114.114.114
[route-ip-pool-3]q


[route]int g0/0/0.1
[route-GigabitEthernet0/0/0.1]dhcp select global 
[route-GigabitEthernet0/0/0.1]q
[route]int g0/0/0.2
[route-GigabitEthernet0/0/0.2]dhcp select global 

五、四台pc通过dhcp自动获取IP

vlan_第5张图片
 vlan_第6张图片

vlan_第7张图片 

vlan_第8张图片 

 

 

 


 

你可能感兴趣的:(p2p,tv,debian)