VLAN实验

一.实验拓扑

 

二.实验要求

1.全网可达;

2.使用DHCP获取IP地址;

三.实验步骤

1.SW接口VLAN配置

SW1

[SW1]int e0/0/1

[SW1-Ethernet0/0/1]port link-type access

[SW1-Ethernet0/0/1]port default vlan 2

[SW1-Ethernet0/0/1]quit

[SW1]int e0/0/2

[SW1-Ethernet0/0/2]port link

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

[SW1-Ethernet0/0/2]port default vlan 3

[SW1-Ethernet0/0/2]quit

[SW1]int e0/0/3

[SW1-Ethernet0/0/3]port trunk                       

[SW1-Ethernet0/0/3]port trunk allow-pass vlan 2 3

SW2

[SW2]vlan 2

[SW2-vlan2]vlan 3

[SW2-vlan3]int e0/0/1

[SW2-Ethernet0/0/1]

[SW2-Ethernet0/0/1]port link-type access

[SW2-Ethernet0/0/1]port default vlan 2

[SW2-Ethernet0/0/1]quit

[SW2]int e0/0/2

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

[SW2-Ethernet0/0/2]port default vlan 3

[SW2-Ethernet0/0/2]

[SW2-Ethernet0/0/2]quit

[SW2]int e0/0/3

[SW2-Ethernet0/0/3]port trunk

[SW2-port-group-trunk]quit

[SW2]int e0/0/3

[SW2-Ethernet0/0/3]port link-type trunk

[SW2-Ethernet0/0/3]port trunk allow-pass vlan 2 3

[SW2-Ethernet0/0/3]int e0/0/4

[SW2-Ethernet0/0/4]port link-type trunk

[SW2-Ethernet0/0/4]port trunk allow-pass vlan 2 3

SW3

[SW3]vlan 2

[SW3-vlan2]vlan 3

[SW3-vlan3]int e0/0/1

[SW3-Ethernet0/0/1]port link-type access

[SW3-Ethernet0/0/1]port default vlan 2

[SW3-Ethernet0/0/1]int e0/0/2

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

[SW3-Ethernet0/0/2]port default vlan 3

[SW3-Ethernet0/0/2]int e0/0/3

[SW3-Ethernet0/0/3]port link-type trunk

[SW3-Ethernet0/0/3]port trunk allow-pass vlan 2 3

  • AR网关配置

R1

[Huawei]int g0/0/1

[Huawei-GigabitEthernet0/0/1]quit

[Huawei]int g0/0/1.1

[Huawei-GigabitEthernet0/0/1.1]ip address 192.168.1.254 24

[Huawei-GigabitEthernet0/0/1.1]dot

[Huawei-GigabitEthernet0/0/1.1]dot1q ter

[Huawei-GigabitEthernet0/0/1.1]dot1q termination vid 2

Mar  2 2023 16:28:58-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol

 IP on the interface GigabitEthernet0/0/1.1 has entered the UP state.

[Huawei-GigabitEthernet0/0/1.1]arp broad

[Huawei-GigabitEthernet0/0/1.1]arp broadcast en

[Huawei-GigabitEthernet0/0/1.1]arp broadcast enable

[Huawei-GigabitEthernet0/0/1.1]int g0/0/1.2

[Huawei-GigabitEthernet0/0/1.2]ip address 192.168.2.254 24

[Huawei-GigabitEthernet0/0/1.2]do

[Huawei-GigabitEthernet0/0/1.2]dot1q ter

[Huawei-GigabitEthernet0/0/1.2]dot1q termination vid 3

Mar  2 2023 16:30:57-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol

 IP on the interface GigabitEthernet0/0/1.2 has entered the UP state.

[Huawei-GigabitEthernet0/0/1.2]arp bro

[Huawei-GigabitEthernet0/0/1.2]arp broadcast en

[Huawei-GigabitEthernet0/0/1.2]arp broadcast enable

[Huawei-GigabitEthernet0/0/1.2]int g0/0/0.1

[Huawei-GigabitEthernet0/0/0.1]ip address 192.168.3.254 24

[Huawei-GigabitEthernet0/0/0.1]do

[Huawei-GigabitEthernet0/0/0.1]dot1q ter

[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 2

[Huawei-GigabitEthernet0/0/0.1]

Mar  2 2023 16:33:57-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[2]:The line protocol

 IP on the interface GigabitEthernet0/0/0.1 has entered the UP state.

[Huawei-GigabitEthernet0/0/0.1]

[Huawei-GigabitEthernet0/0/0.1]

[Huawei-GigabitEthernet0/0/0.1]arp bro

[Huawei-GigabitEthernet0/0/0.1]arp broadcast en

[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable

[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2

[Huawei-GigabitEthernet0/0/0.2]ip address 192.168.4.254 24

[Huawei-GigabitEthernet0/0/0.2]do

[Huawei-GigabitEthernet0/0/0.2]dot1q ter

[Huawei-GigabitEthernet0/0/0.2]dot1q termination vid 3

[Huawei-GigabitEthernet0/0/0.2]

Mar  2 2023 16:36:19-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[3]:The line protocol

 IP on the interface GigabitEthernet0/0/0.2 has entered the UP state.

[Huawei-GigabitEthernet0/0/0.2]arp br

[Huawei-GigabitEthernet0/0/0.2]arp broadcast en

[Huawei-GigabitEthernet0/0/0.2]arp broadcast enable

[Huawei-GigabitEthernet0/0/0.2]quit

[Huawei]sys

[Huawei]sysname R1

  • DHCP

R1

[R1]dhcp enable

Info: The operation may take a few seconds. Please wait for a moment.done.

[R1]ip pool aa

Info: It's successful to create an IP address pool.

[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

[R1-ip-pool-aa]dns-list 114.114.114.114 8.8.8.8

[R1-ip-pool-aa]quit

[R1]int g0/0/1.1

[R1-GigabitEthernet0/0/1.1]dhcp se

[R1-GigabitEthernet0/0/1.1]dhcp select g

[R1-GigabitEthernet0/0/1.1]dhcp select global

[R1-GigabitEthernet0/0/1.1]quit

[R1]ip pool bb

Info: It's successful to create an IP address pool.

[R1-ip-pool-bb]network 192.168.2.0 mask 24

[R1-ip-pool-bb]ga

[R1-ip-pool-bb]gateway-list 192.168.2.254

[R1-ip-pool-bb]dns 114.114.114.114 8.8.8.8

[R1-ip-pool-bb]quit

[R1]ip pool cc

Info: It's successful to create an IP address pool.

[R1-ip-pool-cc]quit

[R1]ip pool bb

[R1-ip-pool-bb]int g0/0/1.2

[R1-GigabitEthernet0/0/1.2]dhcp se

[R1-GigabitEthernet0/0/1.2]dhcp select g

[R1-GigabitEthernet0/0/1.2]dhcp select global

[R1-GigabitEthernet0/0/1.2]quit

[R1]ip pool cc

[R1-ip-pool-cc]network 192.168.3.0 mask 24

[R1-ip-pool-cc]gateway 192.168.3.254

[R1-ip-pool-cc]dns 114.114.114.114 8.8.8.8

[R1-ip-pool-cc]int g0/0/0.1

[R1-GigabitEthernet0/0/0.1]dhcp g

[R1-GigabitEthernet0/0/0.1]dhcp s

[R1-GigabitEthernet0/0/0.1]dhcp select g

[R1-GigabitEthernet0/0/0.1]dhcp select global

[R1-GigabitEthernet0/0/0.1]quit

[R1]ip pool dd

Info: It's successful to create an IP address pool.

[R1-ip-pool-dd]network 192.168.4.0 mask 24

[R1-ip-pool-dd]gateway 192.168.4.254

[R1-ip-pool-dd]dns 114.114.114.114 8.8.8.8

[R1-ip-pool-dd]quit

[R1]int g0/0/0.2

[R1-GigabitEthernet0/0/0.2]dhcp s

[R1-GigabitEthernet0/0/0.2]dhcp select e

[R1-GigabitEthernet0/0/0.2]dhcp select g

[R1-GigabitEthernet0/0/0.2]dhcp select global

  • 测试

P1

 

P2

 

P3

 

P4

 

P5

 

P6

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

鲸珞

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

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

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

打赏作者

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

抵扣说明:

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

余额充值