目录
一、拓扑图
二、相关配置及命令
ZY-Switch-1配置命令
ZY-Switch-2配置命令
ZY-R-A配置命令
ZY-R-B配置命令
ZY-Switch-3配置命令
WEB服务器配置
DNS服务器配置
三、验证过程
台式机(PC)通过DHCP获取IP等相关地址
手机(Smartphone)通过DHCP获取IP等相关地址
笔记本(Laptop)通过DHCP获取IP等相关地址
台式机(PC)与其它相互通信
台式机(PC)上网
手机(Smartphone)上网
笔记本(Laptop)上网
一、拓扑图
二、相关配置及命令
ZY-Switch-1配置命令
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname ZY-Switch-1
ZY-Switch-1(config)#vlan 10
ZY-Switch-1(config-vlan)#exit
ZY-Switch-1(config)#vlan 20
ZY-Switch-1(config-vlan)#exit
ZY-Switch-1(config)#vlan 30
ZY-Switch-1(config-vlan)#exit
ZY-Switch-1(config)#interface fastEthernet 0/1
ZY-Switch-1(config-if)#switchport access vlan 10
ZY-Switch-1(config-if)#exit
ZY-Switch-1(config)#interface fastEthernet 0/2
ZY-Switch-1(config-if)#switchport access vlan 20
ZY-Switch-1(config-if)#exit
ZY-Switch-1(config)#interface fastEthernet 0/24
ZY-Switch-1(config-if)#switchport mode trunk
ZY-Switch-2配置命令
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname ZY-Switch-2
ZY-Switch-2(config)#vlan 10
ZY-Switch-2(config-vlan)#exit
ZY-Switch-2(config)#vlan 20
ZY-Switch-2(config-vlan)#exit
ZY-Switch-2(config)#vlan 30
ZY-Switch-2(config-vlan)#exit
ZY-Switch-2(config)#interface fastEthernet 0/24
ZY-Switch-2(config-if)#switchport trunk encapsulation dot1q
ZY-Switch-2(config-if)#switchport mode trunk
ZY-Switch-2(config-if)#exit
ZY-Switch-2(config)#interface vlan 10
ZY-Switch-2(config-if)#ip address 192.168.10.1 255.255.255.0
ZY-Switch-2(config-if)#exit
ZY-Switch-2(config)#interface vlan 20
ZY-Switch-2(config-if)#ip address 192.168.20.1 255.255.255.0
ZY-Switch-2(config-if)#exit
ZY-Switch-2(config)#interface fastEthernet 0/1
ZY-Switch-2(config-if)#no switchport
ZY-Switch-2(config-if)#ip address 10.10.10.1 255.255.255.224
ZY-Switch-2(config-if)#no shutdown
ZY-Switch-2(config-if)#exit
ZY-Switch-2(config)#ip routing
ZY-Switch-2(config)#router ospf 100
ZY-Switch-2(config-router)#router-id 1.1.1.1
ZY-Switch-2(config-router)#network 192.168.10.0 0.0.0.31 area 0
ZY-Switch-2(config-router)#network 192.168.20.0 0.0.0.31 area 0
ZY-Switch-2(config-router)#network 10.10.10.0 0.0.0.31 area 0
ZY-Switch-2(config-router)#exit
ZY-Switch-2(config)#service dhcp
方法一:
ZY-Switch-2(config)#ip forward-protocol udp bootps
ZY-Switch-2(config)#interface vlan 10
ZY-S