650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/0559435237-0.png "title =" three-layer switching machine current dhcpfunction .png "/>
Vlan da
Vlan 10
Vlan 20
Vlan 30
Vlan 40
Exit
Conf ter
Int vlan 10
Ip add 192.168.1.1 255.255.255.0
Int vlan 20
Ip add 192.168.2.1 255.255.255.0
Int vlan 30
Ip add 192.168.3.1 255.255.255.0
Int vlan 40
Ip add 192.168.4.1 255.255.255.0
Ip routing
Ip dhcp excluded-address 192.168.1.1
Ip dhcp excluded-address 192.168.2.1
Ip dhcp excluded-address 192.168.3.1
Ip dhcp excluded-address 192.168.4.1
Ip dhcp pool 1
Net 192.168.1.0 255.255.255.0
Default-ro 192.168.1.1
Dns-server 1.1.1.1
Ip dhcp pool 2
Net 192.168.2.0 255.255.255.255.0
Default-ro 192.168.2.1
Dns-server 1.1.1.1
Ip dhcp pool 3
Net 192.168.3.0 255.255.255.0
Default-ro 192.168.3.1
Dns-server 1.1.1.1
Ip dhcp pool 4
Net 192.168.4.0 255.255.255.0
Default-ro 192.168.4.1
Dns-server 1.1.1.1
Exit
SW1:
Conf ter
Int f0/1
Sw acc vlan 10
Exit
Int f0/2
Sw acc vlan 20
Exit
Int f0/3
Sw mode trunk
Sw trunk allowed vlan all
Exit
SW2:
Conf ter
Int f0/1
Sw acc vlan 30
Exit
Int f0/2
Sw acc vlan 40
Exit
Int f0/3
Sw mode trunk
Sw trunk allowed vlan all
Exit
Test:
Packet Tracer PC Command Line 1.0
PC> ipconfig/all
FastEthernet0 Connection :( default port)
Physical Address ......: 0030. F2BB. C910
Link-local IPv6 Address ......: FE80: 230: F2FF: FEBB: C910
IP Address ......: 192.168.1.2
Subnet Mask ......: 255.255.255.0
Default Gateway ......: 192.168.1.1
DNS Servers ......
DHCP Servers ......: 192.168.1.1
PC> ipconfig/release
IP Address...
Subnet Mask ......: 0.0.0.0
Default Gateway ......: 0.0.0.0
DNS Server ......: 0.0.0.0
PC> ipconfig/renew
IP Address ......: 192.168.1.2
Subnet Mask ......: 255.255.255.0
Default Gateway ......: 192.168.1.1
DNS Server...
PC> ipconfig/all
FastEthernet0 Connection :( default port)
Physical Address ......: 0030. F2BB. C910
Link-local IPv6 Address ......: FE80: 230: F2FF: FEBB: C910
IP Address ......: 192.168.1.2
Subnet Mask ......: 255.255.255.0
Default Gateway ......: 192.168.1.1
DNS Servers ......
DHCP Servers ......: 192.168.1.1
PC> ping 192.168.4.2
Pinging 192.168.4.2 with 32 bytes of data:
Request timed out.
Reply from 192.168.4.2: bytes = 32 time = 0 msTTL = 127
Reply from 192.168.4.2: bytes = 32 time = 15 msTTL = 127
Reply from 192.168.4.2: bytes = 32 time = 16 msTTL = 127
Ping statistics for 192.168.4.2:
Packets: Sent = 4, stored ED = 3, Lost = 1 (25% loss ),
Approximate round trip times inmilli-seconds:
Minimum = 0 ms, Maximum = 16 ms, Average = 10 ms
PC> ping 192.168.3.2
Pinging 192.168.3.2 with 32 bytes of data:
Request timed out.
Reply from 192.168.3.2: bytes = 32 time = 0 msTTL = 127
Reply from 192.168.3.2: bytes = 32 time = 0 msTTL = 127
Reply from 192.168.3.2: bytes = 32 time = 15 msTTL = 127
Ping statistics for 192.168.3.2:
Packets: Sent = 4, stored ED = 3, Lost = 1 (25% loss ),
Approximate round trip times inmilli-seconds:
Minimum = 0 ms, Maximum = 15 ms, Average = 5 ms
PC> ping 192.168.2.2
Pinging 192.168.2.2 with 32 bytes of data:
Request timed out.
Reply from 192.168.2.2: bytes = 32 time = 16 msTTL = 127
Reply from 192.168.2.2: bytes = 32 time = 15 msTTL = 127
Reply from 192.168.2.2: bytes = 32 time = 0 msTTL = 127
Ping statistics for 192.168.2.2:
Packets: Sent = 4, stored ED = 3, Lost = 1 (25% loss ),
Approximate round trip times inmilli-seconds:
Minimum = 0 ms, Maximum = 16 ms, Average = 10 ms