2

PC 1 is on VLAN 10

PC 2 is on VLAN 20

Router 1 is on VLAN 30

Between SW and Router2 is trunk which allow vlans 10-30

I can ping between PC1 and PC2, but I can't ping from Router 1 any PC. Should I add additional routing ?

UPDATE:

Simpler version ( still not work )

I have a topology like this :

enter image description here

Here is my configuration :

Switch

int fa0/1
sw mode access 
sw access vlan 10

int fa0/2
sw mode access
sw access vlan 20

int fa0/3
sw mode trunk
sw trunk allowed vlan 10-20

Router R_1 configuration

int fa0/0.10
encapsulation dot1q
ip address 10.0.10.1 255.255.255.0

int fa0/0.20
encapsulation dot1q
ip address 10.0.20.1 255.255.255.0

Configuration on PC

ip : 10.0.10.100/24  default gateway : 10.0.10.1

Configuration on Router R_2

int fa0/0
ip address 10.0.20.100 255.255.255.0

Route configurations of R_2

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.0.10.0 is directly connected, FastEthernet0/0.10
C       10.0.20.0 is directly connected, FastEthernet0/0.20

After show run:

Router#show run
Building configuration...

Current configuration : 719 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
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 10.0.10.1 255.255.255.0
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 10.0.20.1 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
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

Route configuration of R_2

Gateway of last resort is 10.0.20.1 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.20.0 is directly connected, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 10.0.20.1

after show run:

Router#show run
Building configuration...

Current configuration : 596 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.0.20.100 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.0.20.1 
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end
14
  • You need to provide configurations so that we can see where you may have gone wrong.
    – Ron Maupin
    Commented Dec 1, 2015 at 21:45
  • It's just a standard configuration of vlans. If I add new PC to the same VLAN as Router 1 I can ping from this new PC computers PC1 and PC2. All computers have default gateway to Router 2.
    – Amon
    Commented Dec 1, 2015 at 21:48
  • 1
    If you want help, we need to see your work. Apparently something is wrong, and we can't guess what it is.
    – Ron Maupin
    Commented Dec 1, 2015 at 21:49
  • 1
    That's not a topology, that's a tag cloud. As @RonMaupin said, please provide details.
    – Teun Vink
    Commented Dec 1, 2015 at 21:52
  • 1
    OK. What doesn't seem to be working now? This configuration is different than your initial description. What pings, and what doesn't?
    – Ron Maupin
    Commented Dec 1, 2015 at 23:47

1 Answer 1

1

I think the part you are missing is that one VLAN cannot talk to another VLAN without having a router between the two VLANs; it's like they are separate cables on separate interfaces.

The switch is a layer-2 device which knows nothing about layer-3 addresses. It can't bridge traffic between VLANs, which is the point of VLANs. The switch will only send traffic from a port on one VLAN to ports or trunks with the same VLAN. It simply cannot take traffic from R_2 on VLAN 20 and send it to the PC on VLAN 10.

Logically, R_2 connects to R_1 on one interface, and the PC connects to R_1 on a different interface. The PC has an implicit default route to its gateway (R_1). R_2 doesn't have an implicit default route so it only knows about the directly connected routes (VLAN 20) and any static routes or routes learned via a routing protocol, but you aren't running a routing protocol. That's why you had to configure a static route.

Static routes, like what you configured on R_2 simply do not scale and are not flexible or dynamic. The real way to do this is to run a common routing protocol on both routers so that R_2 automatically receives a route to VLAN 10 from R_1.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.