Lab Environment:
1. Configure two VLAN 10 and VLAN 20
VLAN IP address settings: 192.168.10.1 255.255.255.0 (192.168.10.1 is a VLAN 10 gateway address)
VLAN IP Address setting: 192.168.20.1 255.255.255.0 (192.168.20.1 is a VLAN 20 gateway address)
2. (Windows Server R2 operating system) set up a DHCP server to create two scopes VLAN 10 and VLAN 20,
Get the IP address dynamically using VLAN 10 and VLAN 20. The DHCP server NIC accesses the switch FA0/1 port.
DHCP server network card settings:
ip:192.168.10.200
Subnet Mask: 255.255.255.0
Gateway: 192.168.10.1
dns1:192.168.10.5 (no DNS server set up, just test use)
dns2:192.168.10.28 (no DNS server set up, just test use)
Annotations: The Cisco 3550 does not support NAT forwarding, and if the upper layer configures a route to do NAT forwarding, the Internet function can be configured.
Implementation features:
1, VLAN 10 and VLAN 20 can ping each other
2, computer access to different VLANs can automatically obtain an IP address
1 , create VLAN ten and VLAN
#特权模式下进入VLAN Sub-mode
switch#VLAN Database
#创建VLAN 10 named Vlan10
Switch (VLAN) #VLAN ten name Vlan10
#创建VLAN 20 named Vlan20
Switch (VLAN) #VLAN # name Vlan20
2 , configure VLAN ten and VLAN the IP Address and Gateway
#全局模式下进入VLAN 10
Switch (config) #interface VLAN
#配置VLAN 10 IP Address and gateway
Switch (config-if) #IP address 192.168.10.1 255.255.255.0
#退出VLAN 10
Switch (config-if) #Exit
#全局模式下进入VLAN 20
Switch (config) #interface VLAN
#配置VLAN 20 IP Address and gateway
Switch (config-if) #IP address 192.168.20.1 255.255.255.0
#退出VLAN 20
Switch (config-if) #Exit
3 , assigning ports to VLANs and VLAN
#全局模式下进入端口fa0/1 and FA0/2
Switch (config) #interface range FastEthernet 0/1-2
#端口fa0/1 and FA0/2 set working mode for access
Switch (config-if-range) #switchport mode access
#端口fa0/1 and FA0/2 assigned to VLAN 10
Switch (config-if-range) #switchport access VLAN
#激活端口
Switch (config-if-range) #no shutdown
#退出
Switch (config-if-range) #Exit
#全局模式下进入端口fa0/5 and FA0/6
Switch (config) #interface range FastEthernet 0/5-6
#端口fa0/5 and FA0/6 set working mode for access
Switch (config-if-range) #switchport mode access
#端口fa0/5 and FA0/6 assigned to VLAN 20
Switch (config-if-range) #switchport access VLAN
#激活端口
Switch (config-if-range) #no shutdown
#退出
Switch (config-if-range) #Exit
#全局模式下开启路由 so that VLANs can access each other
Switch (config) #IP Routing
4 , the VLAN to which the computer belongs Configuring the Relay Agent
#全局模式下进入VLAN 10
Switch (config) #interface VLAN
#配置VLAN 10 Relay Agent, 192.168.10.200 is the DHCP server address
Switch (config-if) #IP helper-address 192.168.10.200
#退出VLAN 10
Switch (config-if) #Exit
#全局模式下进入VLAN 20
Switch (config) #interface VLAN
#配置VLAN 20 Relay Agent, 192.168.10.200 is the DHCP server address
Switch (config-if) #IP helper-address 192.168.10.200
#退出VLAN 20
Switch (config-if) #Exit
5 , save, and view operations
#特权模式下执行保存配置
switch#Write
#查看vlan分配端口信息
switch#Show VLAN
#查看当前配置信息
switch#Show Running-config
#查看路由选择表当前状态
switch#show ip route
Cisco 3550 Configuration DHCP Relay Agent