实验要求:1.全网可达;
2.使用DHCP获取IP地址;
实验思路:
1.配置交换机
创建VLAN
更改交换机接口链路类型
配置trunk干道,放通vlan
2.配置路由器
配置子接口
配置DHCP服务
在接口下放DHCP服务
实验准备:分别vlan2,3---PC1,3,5为vlan2;PC2,4,6为vlan3
路由器左侧网段:
vlan2:192.168.1.0/24
vlan3:192.168.2.0/24
路由器右侧网段:
vlan2:192.168.3.0/24
vlan3:192.168.4.0/24
首先PC采取DHCP获取IP地址
配置交换机
进入交换机配置vlan,三个交换机过程一致
[sw2]vlan 2
[sw2-vlan2]quit
[sw2]vlan 3
[sw2-vlan3]
更改交换机模式,并且配置trunk干道,放通vlan
[sw3]int g0/0/2
[sw3-GigabitEthernet0/0/2]portlink-type access
[sw3-GigabitEthernet0/0/2]port default vlan 2
[sw3-Gigabnet0/0/2]int g0/0/3
[sw3-GigabitEthernet0/0/3]port link-type access
[sw3-GigabitEthernet0/0/3]port default vlan 2
[sw3-GigabitEthernet0/0/3]quit
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]portlink-type trunk
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
[sw3-GigabitEthernet0/0/1]quit
[sw2]int g0/0/3
[sw2-GigabitEthernet0/0/3]port link-type access
[sw2-GigabitEthernet0/0/3]port default vlan 2
[Ethernet0/0/3]int g0/0/4
[sw2-GigabitEthernet0/0/4]port link-type access
[sw2-GigabitEthernet0/0/4]port default vlan 3
[sw2-GigabitEthernet0/0/4]quit
[sw2]int g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type trunk
[sw2-GigabitEthernet0/0/2]port default allow-pass vlan 2 3
[sw2-GigabitEthernet0/0/2]quit
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk aollow-pass vlan 2 3
[sw3]dis port vlan active---查看
配置路由器
配置子接口
[R8]int g0/0/0.3
[R8-GigabitEthernet0/0/0.3]ip add 192.168.2.254 24
[R8-GigabitEthernet0/0/0.3]dot1q termination vid 3
[R8-GigabitEthernet0/0/0.3]arp broadcast enable
R8-GigabitEthernet0/0/0.3]quit
[R8]int g0/0/1.2
[R8-GigabitEthernet0/0/1.2]ip add 192.168.3.254 24
[R8-GigabitEthernet0/0/1.2]dot1q termination vid 2
[R8-GigabitEthernet0/0/1.2]arp broadcost enable
[R8-GigabitEthernet0/0/1.2]int g0/0/1.3
[R8-GigabitEthernet0/0/1.3]ip add 192.168.4.254 24
[R8-GigabitEthernet0/0/1.3]dot1q termination vid 3
[R8-GigabitEthernet0/0/1.3]arp broadcost enable
配置DHCP服务
[R8]ip pool aa--配置地址池
[R8-ip-pool-aa]network 192.168.1.0 mask 24
[R8-ip-pool-aalgateway-list 192.168.1.254
[R8-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[R8-ip-pool-aa]quit
[R8]int g0/0/0.2
[R8-GigabitEthernet0/0/0.2]dhcp select global---从接口下发DHCP服务
在PC机进行ping检查
完成配置
最后进行检查是否全网通----PC端之间进行ping文章来源:https://www.toymoban.com/news/detail-814579.html
ping通,完成实验文章来源地址https://www.toymoban.com/news/detail-814579.html
到了这里,关于VLAN实验的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!