vlan实验

<Huawei>undo terminal monitor 

lsw1

[Huawei]sysname lsw1

[lsw1]interface g 0/0/2  
[lsw1-GigabitEthernet0/0/2]port link-type access  
[lsw1-GigabitEthernet0/0/2]port default vlan 2

[lsw1]interface g0/0/3
[lsw1-GigabitEthernet0/0/3]port link-type  access  
[lsw1-GigabitEthernet0/0/3]port default  vlan 3
[lsw1]interface g0/0/1   
[lsw1-GigabitEthernet0/0/1]port link-type trunk 
[lsw1-GigabitEthernet0/0/1]port trunk  allow-pass  vlan 2 3
[lsw1]display port vlan active 
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port                Link Type    PVID    VLAN List
-------------------------------------------------------------------------------
GE0/0/1             trunk        1       U: 1
                                         T: 2 to 3
GE0/0/2             access       2       U: 2
GE0/0/3             access       3       U: 3

lsw2
<Huawei>undo terminal monitor 

[lsw2]vlan 2

[lsw2]vlan 3

lsw2]interface g0/0/2 
[lsw2-GigabitEthernet0/0/2]port link-type access   
[lsw2-GigabitEthernet0/0/2]port default vlan 2
[lsw2]interface g0/0/3
[lsw2-GigabitEthernet0/0/3]port link-type access
[lsw2-GigabitEthernet0/0/3]port default vlan 3
[lsw2]interface g0/0/1
[lsw2-GigabitEthernet0/0/1]port link-type trunk 
[lsw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3

[lsw2]interface g0/0/4
[lsw2-GigabitEthernet0/0/1]port link-type trunk 
[lsw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3

[lsw2]display port vlan active 
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port                Link Type    PVID    VLAN List
-------------------------------------------------------------------------------
GE0/0/1             trunk        1       U: 1
                                         T: 2 to 3
GE0/0/2             access       2       U: 2
GE0/0/3             access       3       U: 3
GE0/0/4             trunk        1       U: 1
                                         T: 2 to 3
GE0/0/5             hybrid       1       U: 1
 

lsw3

[lsw3]interface g0/0/1
[lsw3-GigabitEthernet0/0/1]port link-type access    
[lsw3-GigabitEthernet0/0/1]port default vlan 2

[lsw3]interface g0/0/2
[lsw3-GigabitEthernet0/0/2]port link-type access  
[lsw3-GigabitEthernet0/0/2]port default  vlan 3
[lsw3]interface g0/0/3 
[lsw3-GigabitEthernet0/0/3]port link-type trunk 
[lsw3-GigabitEthernet0/0/3]port trunk allow-pass  vlan 2 3
[lsw3]display port vlan active 
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port                Link Type    PVID    VLAN List
-------------------------------------------------------------------------------
GE0/0/1             access       2       U: 2
GE0/0/2             access       3       U: 3
GE0/0/3             trunk        1       U: 1
                                         T: 2 to 3
GE0/0/4             hybrid       1       U: 1
R1

Huawei]sysname r1
[r1]interface g0/0/0.2
[r1-GigabitEthernet0/0/0.2]ip add 192.168.1.254 24
[r1-GigabitEthernet0/0/0.2]dot1q termination  vid 2
[r1-GigabitEthernet0/0/0.2]arp broadcast  enable 
r1]interface g0/0/0.3
[r1-GigabitEthernet0/0/0.3]ip add 192.168.2.254 24
[r1-GigabitEthernet0/0/0.3]dot1q termination vid 3
[r1-GigabitEthernet0/0/0.3]arp broadcast enable
[r1]interface g0/0/1.2
[r1-GigabitEthernet0/0/1.2]ip add 192.168.3.254 24
[r1-GigabitEthernet0/0/1.2]dot1q termination vid 2
[r1-GigabitEthernet0/0/1.2]arp broadcast enable
[r1]interface g0/0/1.3
[r1-GigabitEthernet0/0/1.3]ip add 192.168.4.254 24
[r1-GigabitEthernet0/0/1.3]dot1q termination vid 3
[r1-GigabitEthernet0/0/1.3]arp broadcast enable

[r1]display ip routing-table 

[r1]dhcp enable 

r1]ip pool aa
[r1-ip-pool-aa]network 192.168.1.0 mask 24
[r1-ip-pool-aa]gateway-list 192.168.1.254

[r1-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[r1-ip-pool-aa]q
[r1]interface g0/0/0.2
[r1-GigabitEthernet0/0/0.2]dhcp select global

[r1]ip pool bb
[r1-ip-pool-bb]network 192.168.2.0 mask 24   
[r1-ip-pool-bb]gateway-list  192.168.1.254
[r1-ip-pool-bb]gateway-list 192.168.2.254    
[r1-ip-pool-bb]dns-list 8.8.8.8 114.114.114.114
[r1]interface g0/0/0.3 
[r1-GigabitEthernet0/0/0.3]dhcp select global   
[r1]ip pool cc    
[r1-ip-pool-cc]network 192.168.3.0 mask 24
[r1-ip-pool-cc]gateway-list 192.168.3.254  
[r1-ip-pool-cc]dns-list 8.8.8.8 114.114.114.114
[r1-ip-pool-cc]q
[r1]interface g0/0/1.2   
[r1-GigabitEthernet0/0/1.2]dhcp select  global

[r1]ip pool dd   
[r1-ip-pool-dd]network 192.168.4.0 mask 24  
[r1-ip-pool-dd]gateway-list 192.168.1.254
[r1-ip-pool-dd]gateway-list 192.168.4.254
[r1-ip-pool-dd]dns-list 8.8.8.8 114.114.114.114
[r1-ip-pool-dd]q
[r1]interface g0/0/1.3 
[r1-GigabitEthernet0/0/1.3]dhcp select global 

随机p3拼p2

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值