HCIA ---VLAN实验
一、实验要求
按要求划分VLAN,全网可达,电脑IP使用DHCP获取
二、实验拓扑
三、IP的地址规划
整个拓扑有四个广播域,总有四个VLAN,
四、配置信息
关闭日志文件:
<sw1>undo terminal monitor
交换机1的配置详细信息:
1.先配置交换机 ,创建vlan
[sw1]vlan 2
[sw1]vlan 3
2.划分vlan
[sw1]int g0/0/2
[sw1-GigabitEthernet0/0/2]port link-type access
[sw1-GigabitEthernet0/0/2]port default vlan 2
[sw1]int g 0/0/3
[sw1-GigabitEthernet0/0/3]port link-type access
[sw1-GigabitEthernet0/0/3]port default v 3
3.配置trunk干道
[sw1]INT G 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
交换机2的所有配置信息:
[sw2]vlan 2
[sw2]vlan 3
[sw2]int g 0/0/3
[sw2-GigabitEthernet0/0/3]port link-type access
[sw2-GigabitEthernet0/0/3]port default vlan 2
[sw2]int g 0/0/4
[sw2-GigabitEthernet0/0/4]port link-type access
[sw2-GigabitEthernet0/0/4]port default v 3
[sw2]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type trunk
[sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan a
[sw2-GigabitEthernet0/0/2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
交换机3的配置信息:
[sw3]int g 0/0/2
[sw3-GigabitEthernet0/0/2]port link-type access
[sw3-GigabitEthernet0/0/2]port default vlan 2
[sw3]int g 0/0/3
[sw3-GigabitEthernet0/0/3]port link-type access
[sw3-GigabitEthernet0/0/3]port default vlan 3
[sw3-GigabitEthernet0/0/3]
[sw3]int g 0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
三台交换机配置结束,现在要跨VLAN通信就要配置路由器;
子接口配置:
[r1]int g 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0.1]int g 0/0/0.2
[r1-GigabitEthernet0/0/0.2]ip add 192.168.2.1 24
[r1-GigabitEthernet0/0/0.2]dot1q termination vid 3
[r1-GigabitEthernet0/0/0.2]arp broadcast enable
[r1-GigabitEthernet0/0/1]int g0/0/1.1
[r1-GigabitEthernet0/0/1.1]ip add 192.168.3.1 24
[r1-GigabitEthernet0/0/1.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/1.1]arp broadcast enable
[r1-GigabitEthernet0/0/1.1]int g0/0/1.2
[r1-GigabitEthernet0/0/1.2]ip add 192.168.4.1 24
[r1-GigabitEthernet0/0/1.2]dot1q termination vid 3
[r1-GigabitEthernet0/0/1.2]arp broadcast enable
接下来获取DHCP配置:
[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.1
[r1-ip-pool-aa]dns-list 114.114.114.114
[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]gateway-list 192.168.2.1
[r1-ip-pool-bb]dns-list 114.114.114.114
[r1]ip pool cc
Info: It's successful to create an IP address pool.
[r1-ip-pool-cc]network 192.168.3.0 mask 24
[r1-ip-pool-cc]gateway-list 192.168.3.1
[r1-ip-pool-cc]dns-list 114.114.114.114
[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-list 192.168.4.1
[r1-ip-pool-dd]dns-list 114.114.114.114
进入子接口选举全局配置:
[r1]int g 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1-GigabitEthernet0/0/0.1]int g 0/0/0.2
[r1-GigabitEthernet0/0/0.2]dhcp select global
[r1-GigabitEthernet0/0/0.2]int g 0/0/1.1
[r1-GigabitEthernet0/0/1.1]dhcp select global
[r1-GigabitEthernet0/0/1.1]int g0/0/1.2
[r1-GigabitEthernet0/0/1.2]dhcp select global
全部配置完成 可以测试了
DHCP获取成功,每个PC间的通行测试:
作者:ChAn
-------------------------------------------
个性签名:今天做了别人不想做的事,明天你就做得到别人做不到的事,尝试你都不敢,你拿什么赢!
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!