Troubleshooting VLANs on the Same Router That Can’t Ping Each Other

routerswitchvlan

I'm using the student version of cisco packet tracer 6.2.

I have two vlans that are connected to the same router but they can't ping each other. Here is the config from my router and my switch.

My router:

version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
hostname Router
ip dhcp excluded-address 192.168.10.254
ip dhcp excluded-address 192.168.20.254
ip dhcp pool 10
network 192.168.10.0 255.255.255.0
ip dhcp pool 20
network 192.168.20.0 255.255.255.0
ip cef
no ipv6 cef
spanning-tree mode pvst
interface FastEthernet0/0
no ip address
duplex auto
speed auto
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
interface Vlan1
no ip address
shutdown
ip classless
ip flow-export version 9
no cdp run
line con 0
line aux 0
line vty 0 4
 login
end

and my switch:

version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
hostname Switch
spanning-tree mode pvst
interface FastEthernet0/1
switchport access vlan 10
interface FastEthernet0/2
switchport access vlan 20
interface FastEthernet0/3
switchport mode trunk
ports 4-24 are not configured. 
interface Vlan1
no ip address
shutdown
line con 0
line vty 0 4
login
line vty 5 15
login
end

Best Answer

You forgot the default gateway in the DHCP configurations. You need one for each pool:

default-router 192.168.x.254