Router:
vlan da
vlan 2
vlan 3
exit
conf ter
ip dhcp exc 192.168.1.1
ip dhcp exc 192.168.2.1
ip dhcp pool a
net 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 1.1.1.1
exit
ip dhcp pool b
net 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 1.1.1.1
exit
int f0/0
no shu
int f0/0.1
enc do 2
ip add 192.168.1.1 255.255.255.0
int f0/0.2
enc do 3
ip add 192.168.2.1 255.255.255.0
exit
Switch:
conf ter
int range f0/1-5
sw acc vlan 2
int range f0/6-10
sw acc vlan 3
int f0/24
sw mode trunk
sw trunk allowed vlan all
exit
PC1:
Packet Tracer PC Command Line 1.0
PC>ipconfig /all
FastEthernet0 Connection:(default port)
Physical Address................: 0090.2B16.6C58
Link-local IPv6 Address.........:FE80::290:2BFF:FE16:6C58
IP Address......................:192.168.1.2
Subnet Mask.....................:255.255.255.0
Default Gateway.................:192.168.1.1
DNS Servers.....................: 1.1.1.1
DHCP Servers....................:192.168.1.1
PC>ipconfig /release
IP Address......................: 0.0.0.0
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......................: 1.1.1.1
PC>ping 192.168.2.2
Pinging 192.168.2.2 with 32 bytes of data:
Reply from 192.168.2.2: bytes=32 time=15msTTL=127
Reply from 192.168.2.2: bytes=32 time=0msTTL=127
Reply from 192.168.2.2: bytes=32 time=16msTTL=127
Reply from 192.168.2.2: bytes=32 time=15msTTL=127
Ping statistics for 192.168.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times inmilli-seconds:
Minimum = 0ms, Maximum = 16ms, Average = 11ms
PC2:
Packet Tracer PC Command Line 1.0
PC>ipconfig /all
FastEthernet0 Connection:(default port)
Physical Address................:00D0.FF80.55E7
Link-local IPv6 Address.........:FE80::2D0:FFFF:FE80:55E7
IP Address......................:192.168.2.2
Subnet Mask.....................:255.255.255.0
Default Gateway.................:192.168.2.1
DNS Servers.....................: 1.1.1.1
DHCP Servers....................:192.168.2.1
PC>ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data:
Request timed out.
Reply from 192.168.1.2: bytes=32 time=0msTTL=127
Reply from 192.168.1.2: bytes=32 time=30msTTL=127
Reply from 192.168.1.2: bytes=32 time=0msTTL=127
Ping statistics for 192.168.1.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times inmilli-seconds:
Minimum = 0ms, Maximum = 30ms, Average = 10ms