实验名称
多VLAN配置
实验拓扑图如下
实验要求
1.全网可达;
2.使用DHCP获取IP地址;
实验思路
1.创建vlan域。
2.配置交换机的vlan。
3.配置路由器的vlan。
4.配置DHCP协议。
5.检查。
实验步骤
一
增添vlan域
S1
[S 3700 NO.1]vlan 2
[S 3700 NO.1-vlan2]quit
[S 3700 NO.1]vlan 3
[S 3700 NO.1-vlan3]quit
S2
[S 3700 NO.2]vlan 2
[S 3700 NO.2-vlan2]quit
[S 3700 NO.2]vlan 3
[S 3700 NO.2-vlan3]quit
S3
[S 3700 NO.3]vlan 2
[S 3700 NO.3-vlan2]quit
[S 3700 NO.3]vlan 3
[S 3700 NO.3-vlan3]quit
此时可以用【display vlan】命令来检查是否新增vlan域
如S1所示:
二
关联端口和vlan
S1
[S 3700 NO.1]int e0/0/2
[S 3700 NO.1-Ethernet0/0/2]port link-type access
[S 3700 NO.1-Ethernet0/0/2]port default vlan 2
[S 3700 NO.1-Ethernet0/0/2]quit
[S 3700 NO.1]int e0/0/3
[S 3700 NO.1-Ethernet0/0/3]port link-type access
[S 3700 NO.1-Ethernet0/0/3]port default vlan 3
S2
[S 3700 NO.2]int e0/0/3
[S 3700 NO.2-Ethernet0/0/3]port link-type access
[S 3700 NO.2-Ethernet0/0/3]port default vlan 2
[S 3700 NO.2-Ethernet0/0/3]quit
[S 3700 NO.2]int e0/0/4
[S 3700 NO.2-Ethernet0/0/4]port link-type access
[S 3700 NO.2-Ethernet0/0/4]port default vlan 3
S3
[S 3700 NO.3]int e0/0/2
[S 3700 NO.3-Ethernet0/0/2]port link-type access
[S 3700 NO.3-Ethernet0/0/2]port default vlan 2
[S 3700 NO.3-Ethernet0/0/2]quit
[S 3700 NO.3]int e0/0/3
[S 3700 NO.3-Ethernet0/0/3]port link-type access
[S 3700 NO.3-Ethernet0/0/3]port default vlan 3
此时可以用【display port vlan active】命令来检查是否关联
如S1所示
三
配置路由器
AR 1
[S 3700 NO.1]int e0/0/1
[S 3700 NO.1-Ethernet0/0/1]port link-type trunk
[S 3700 NO.1-Ethernet0/0/1]port trunk allow-pass vlan 2 3
AR2
[S 3700 NO.2]int e0/0/1
[S 3700 NO.2-Ethernet0/0/1]port link-type trunk
[S 3700 NO.2-Ethernet0/0/1]port trunk allow-pass vlan 2 3
[S 3700 NO.2-Ethernet0/0/1]quit
[S 3700 NO.2]int e0/0/2
[S 3700 NO.2-Ethernet0/0/2]port link-type trunk
[S 3700 NO.2-Ethernet0/0/2]port trunk allow-pass vlan 2 3
AR 3
[S 3700 NO.3]int e0/0/1
[S 3700 NO.3-Ethernet0/0/1]port link-type trunk
[S 3700 NO.3-Ethernet0/0/1]port trunk allow-pass vlan 2 3
四
配置路由器
AR1
增加单臂路由子接口
[AR 2220 NO.1]int g0/0/0.2
[AR 2220 NO.1-GigabitEthernet0/0/0.2]ip add 192.168.1.254 24
[AR 2220 NO.1-GigabitEthernet0/0/0.2]dot1q termination vid 2
[AR 2220 NO.1-GigabitEthernet0/0/0.2]arp broadcast enable
[AR 2220 NO.1-GigabitEthernet0/0/0.2]int g0/0/0.3
[AR 2220 NO.1-GigabitEthernet0/0/0.3]ip add 192.168.2.254 24
[AR 2220 NO.1-GigabitEthernet0/0/0.3]dot1q termination vid 3
[AR 2220 NO.1-GigabitEthernet0/0/0.3]arp broadcast enable
[AR 2220 NO.1-GigabitEthernet0/0/0.2]int g0/0/1.2
[AR 2220 NO.1-GigabitEthernet0/0/1.2]ip add 192.168.3.254 24
[AR 2220 NO.1-GigabitEthernet0/0/1.2]dot1q termination vid 2
[AR 2220 NO.1-GigabitEthernet0/0/1.2]arp broadcast enable
[AR 2220 NO.1-GigabitEthernet0/0/1.2]int g0/0/1.3
[AR 2220 NO.1-GigabitEthernet0/0/1.3]ip add 192.168.4.254 24
[AR 2220 NO.1-GigabitEthernet0/0/1.3]dot1q termination vid 3
[AR 2220 NO.1-GigabitEthernet0/0/1.3]arp broadcast enable
[AR 2220 NO.1-GigabitEthernet0/0/1.3]quit
如图
[AR 2220 NO.1]dhcp enable
[AR 2220 NO.1]ip pool 1
[AR 2220 NO.1-ip-pool-1]network 192.168.1.0 mask 24
[AR 2220 NO.1-ip-pool-1]gateway-list 192.168.1.254
[AR 2220 NO.1-ip-pool-1]dns-list 8.8.8.8 114.114.114.114
[AR 2220 NO.1-ip-pool-1]quit
[AR 2220 NO.1]int g0/0/0.2
[AR 2220 NO.1-GigabitEthernet0/0/0.2]dhcp select global
[AR 2220 NO.1-GigabitEthernet0/0/0.2]quit
[AR 2220 NO.1]ip pool 2
[AR 2220 NO.1-ip-pool-2]network 192.168.2.0 mask 24
[AR 2220 NO.1-ip-pool-2]gateway-list 192.168.2.254
[AR 2220 NO.1-ip-pool-2]dns-list 8.8.8.8 114.114.114.114
[AR 2220 NO.1-ip-pool-2]quit
[AR 2220 NO.1]int g0/0/0.3
[AR 2220 NO.1-GigabitEthernet0/0/0.3]dhcp select global
[AR 2220 NO.1-GigabitEthernet0/0/0.3]quit
[AR 2220 NO.1]ip pool 3
[AR 2220 NO.1-ip-pool-3]network 192.168.3.0 mask 24
[AR 2220 NO.1-ip-pool-3]gateway-list 192.168.3.254
[AR 2220 NO.1-ip-pool-3]dns-list 8.8.8.8 114.114.114.114
[AR 2220 NO.1-ip-pool-3]quit
[AR 2220 NO.1]int g0/0/1.2
[AR 2220 NO.1-GigabitEthernet0/0/1.2]dhcp select global
[AR 2220 NO.1-GigabitEthernet0/0/1.2]quit
[AR 2220 NO.1]ip pool 4
[AR 2220 NO.1-ip-pool-4]network 192.168.4.0 mask 24
[AR 2220 NO.1-ip-pool-4]gateway-list 192.168.4.254
[AR 2220 NO.1-ip-pool-4]dns-list 8.8.8.8 114.114.114.114
[AR 2220 NO.1-ip-pool-4]quit
[AR 2220 NO.1]int g0/0/1.3
[AR 2220 NO.1-GigabitEthernet0/0/1.3]dhcp select global
五
检查
实验结束