interface FastEthernet0/2(將端口f0/2劃分入vlan2) switchport access vlan 2 switchport mode access no ip address ! interface FastEthernet0/3(將端口f0/3劃分入vlan3) switchport access vlan 3 switchport mode access no ip address ......
interface Vlan1 ip address 192.168.1.2 255.255.255.0 ip helper-address 192.168.1.1 (將DHCP請求的廣播數據包轉化為單播請求,路由器才會響應) ! interface Vlan2 ip address 192.168.2.1 255.255.255.0 ip helper-address 192.168.1.1 ! interface Vlan3 ip address 192.168.3.1 255.255.255.0 ip helper-address 192.168.1.1
路由器2621上的配置: ip dhcp pool tyl-01(配置第一個VLAN的地址池) network 192.168.1.0 255.255.255.0 default-router 192.168.1.1 (配置PC網關) dns-server 202.96.134.133(配置DNS服務器)
ip dhcp pool tyl-02(配置第二個VLAN的地址池) network 192.168.2.0 255.255.255.0 default-router 192.168.2.1 dns-server 202.96.134.133
ip dhcp pool tyl-03(配置第三個VLAN的地址池) network 192.168.3.0 255.255.255.0 default-router 192.168.3.1 dns-server 202.96.134.133
ip route 192.168.2.0 255.255.255.0 192.168.1.2(配置靜態路由) ip route 192.168.3.0 255.255.255.0 192.168.1.2
ip dhcp excluded-address 192.168.1.1 192.168.1.2 (將路由器F0/0和3550 VLAN1的IP 地址排除) ip dhcp excluded-address 192.168.2.1 (3550 VLAN1的IP 地址排除) ip dhcp excluded-address 192.168.3.1 (3550 VLAN1的IP 地址排除)