Dear các bạn,
Mình có sơ đồ sau:
Cấu hình của R72:
Cấu hình SW72:
PC0:
PC1:
PC2:
Các máy tính PC0 nhận được IP từ DHCP là 192.168.3.1 DG: 192.168.3.240 đã ping được PC1 có IP 172.16.3.1 DG 172.16.3.240
Máy tính PC2 có địa chỉ 192.168.2.1 không gán default gateway là không ping được các máy PC0, PC1
Xin hỏi các bạn phải làm thế nào để PC0 - PC1 có thể ping được PC2?
Mình có sơ đồ sau:
Cấu hình của R72:
R72#show run
Building configuration...
Current configuration : 1002 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R72
!
!
!
!
ip dhcp excluded-address 192.168.3.240
ip dhcp excluded-address 172.16.3.240
!
ip dhcp pool WIFI-72
network 192.168.3.0 255.255.255.0
default-router 192.168.3.240
dns-server 8.8.8.8
ip dhcp pool WIFI-IL
network 172.16.3.0 255.255.255.0
default-router 172.16.3.240
dns-server 8.8.8.8
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.3.240 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 172.16.3.240 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.2.240 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 192.168.2.0 255.255.255.0 FastEthernet0/1
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
Building configuration...
Current configuration : 1002 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R72
!
!
!
!
ip dhcp excluded-address 192.168.3.240
ip dhcp excluded-address 172.16.3.240
!
ip dhcp pool WIFI-72
network 192.168.3.0 255.255.255.0
default-router 192.168.3.240
dns-server 8.8.8.8
ip dhcp pool WIFI-IL
network 172.16.3.0 255.255.255.0
default-router 172.16.3.240
dns-server 8.8.8.8
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.3.240 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 172.16.3.240 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.2.240 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 192.168.2.0 255.255.255.0 FastEthernet0/1
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
SW72#show run
Building configuration...
Current configuration : 1564 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW72
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/4
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/5
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/6
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/8
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/9
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/10
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
switchport mode trunk
!
interface GigabitEthernet1/1
!
interface GigabitEthernet1/2
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
Building configuration...
Current configuration : 1564 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW72
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/4
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/5
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/6
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/8
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/9
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/10
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
switchport mode trunk
!
interface GigabitEthernet1/1
!
interface GigabitEthernet1/2
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
Packet Tracer PC Command Line 1.0
PC>ipconfig /all
Physical Address................: 0010.118A.971A
IP Address......................: 192.168.3.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.3.240
DNS Servers.....................: 8.8.8.8
PC>ipconfig /all
Physical Address................: 0010.118A.971A
IP Address......................: 192.168.3.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.3.240
DNS Servers.....................: 8.8.8.8
PC>ipconfig /all
Physical Address................: 0030.F2DB.3863
IP Address......................: 172.16.3.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 172.16.3.240
DNS Servers.....................: 8.8.8.8
Physical Address................: 0030.F2DB.3863
IP Address......................: 172.16.3.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 172.16.3.240
DNS Servers.....................: 8.8.8.8
PC>ipconfig /all
Physical Address................: 0040.0BA5.B848
IP Address......................: 192.168.2.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 0.0.0.0
DNS Servers.....................: 0.0.0.0
Physical Address................: 0040.0BA5.B848
IP Address......................: 192.168.2.1
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 0.0.0.0
DNS Servers.....................: 0.0.0.0
Máy tính PC2 có địa chỉ 192.168.2.1 không gán default gateway là không ping được các máy PC0, PC1
Xin hỏi các bạn phải làm thế nào để PC0 - PC1 có thể ping được PC2?
Comment