一.实验拓扑图
第一步,对交换机配置线路,建立vlan
undo terminal monitor关闭系统监视
【sw1】int e0/0/1 port link-type accesss//配置接口的链路类型
port default vlan 2//修改接口的pvld
int e0/0/3 port link-type trunk
port trunk allow-pass vlan 2 3
display port vlan active 查看接口和vlan id 的对应关系
接着设立R1路由器
int g0/0/0.2 ip add 192.168.1.254 24
dot1q termination vid 2 开启接口能识别802.1Q数据帧的功能,同时能够将子接口划分给相应的vlan
arp broadcast enable 开启ARP广播,向真实的物理接口借MAC地址
再启用DHCP
DHCP enable建立地址池
[R2]ip pool aa
Info: It's successful to create an IP address pool.
[R2-ip-pool-aa]network 192.168.1.0 mask 24
[R2-ip-pool-aa]gateway-list 192.168.1.254
[R2-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[R2-ip-pool-aa]quit
再进行下放
[R2]int g0/0/0.2
[R2-GigabitEthernet0/0/0.2]dhcp select global
[R2-GigabitEthernet0/0/0.2]quit
接着打开pc6进行对其他电脑进行检验网络是否接通
ping 192.168.3.253
成功ping通,实验成功