vlan实验

vlan2:192.168.1.0/24

vlan3:192.168.2.0/24

使用DHCP,实现全网可达。

第一步、创建vlan

[LSW1]vlan batch 2 to 3
Info: This operation may take a few seconds. Please wait for a moment...done.

[LSW2]vlan batch 2 to 3
Info: This operation may take a few seconds. Please wait for a moment...done.

第二步、划分接口到vlan

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

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

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

[LSW1]interface e0/0/4
[LSW1-Ethernet0/0/4]port link-type access 
[LSW1-Ethernet0/0/4]port default vlan 3
[LSW2]interface e0/0/1
[LSW2-Ethernet0/0/1]port link-type access 
[LSW2-Ethernet0/0/1]port default vlan 2

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

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

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

第三步、修改trunk干道

[LSW1]interface e0/0/5
[LSW1-Ethernet0/0/5]port link-type trunk 
[LSW1-Ethernet0/0/5]port trunk allow-pass vlan all

[LSW2]interface e0/0/5
[LSW2-Ethernet0/0/5]port link-type trunk      
[LSW2-Ethernet0/0/5]port trunk allow-pass vlan all

第四步、修改路由器和交换机之间的接口

[LSW1]interface e0/0/6
[LSW1-Ethernet0/0/6]port link-type trunk 
[LSW1-Ethernet0/0/6]port trunk allow-pass vlan all 

[AR1]interface g0/0/0.1
[AR1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[AR1-GigabitEthernet0/0/0.1]ip address 192.168.1.254 24
[AR1-GigabitEthernet0/0/0.1]arp broadcast enable
[AR1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[AR1]ip pool a
[AR1-ip-pool-a]network 192.168.1.0 mask 24
[AR1-ip-pool-a]gateway-list 192.168.1.254
[AR1-ip-pool-a]q
[AR1]interface g0/0/0.1
[AR1-GigabitEthernet0/0/0.1]dhcp select global

[AR1]interface g0/0/0.2
[AR1-GigabitEthernet0/0/0.2]dot1q termination vid 3
[AR1-GigabitEthernet0/0/0.2]ip address 192.168.2.254 24
[AR1-GigabitEthernet0/0/0.2]arp broadcast enable
[AR1]ip pool b
Info: It's successful to create an IP address pool.
[AR1-ip-pool-b]network 192.168.2.0 mask 24
[AR1-ip-pool-b]gateway-list 192.168.2.254
[AR1-ip-pool-b]q
[AR1]interface g0/0/0.2
[AR1-GigabitEthernet0/0/0.2]dhcp select global

实验完成

  • 6
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

头发巨多不做程序猿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值