Communicating to a router from a VLAN

Unanswered Question
Nov 28th, 2007

Hi all,

I've got a network setup of 2 switches that communicate and transmit data across a VLAN. Trunking is enabled between them, but when i add a router to tranverse to an alternative site i can't seem to get the host on say vlan 10 to ping the routers interface. What am i doing wrong? I've set the default gateway to the routers interface but i haven't assigned the router any VLAN information.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Kevin Dorrell Wed, 11/28/2007 - 07:19

You will need to set the link to the router as a trunk. You could take the trunk between your switches as a model.

Then, on your router, you will need to create a sub-interface for each VLAN. For example, for VLAN 10:

interface FastEthernet0/0.10

encapsulation dot1q 10

ip address

The sub-interface number is arbitrary, but it is good to keep it the same as the VLAN for neatness. The number in the encapsulation command tells it which VLAN it is talking to. The IP address is the gateway address your hosts will use.

Kevin Dorrell


Ibbywannit Wed, 11/28/2007 - 07:40

That explanation was absolutely perfect. Thanks. Now that i can ping to the routers interface are their any additional commands that i would need to enable the information to cross from one site to the other across a plain serial link? The routers should just transmit the packets without any additional configuration - correct?

Kevin Dorrell Wed, 11/28/2007 - 08:58

Not quite. You will have to tell the router how to get to each network at the remote site.

Start by giving your serial link an IP address at each end, something like this:

interface Serial0/0

ip address

and the same thing at the other end, but make it Adapt the addresses as you need. Ping from one router to the other to make sure it works.

Then you will need to set up some routing. The easiest way is static routes, but not too scaleable. Suppose the network is at the other site, then introduce:

ip route

That will route all packets for that network to the other site.

Don't forget to do the same thing in reverse on the other site to get the replies routed back.

Or you could just put a default route on each router to the other site, like this. Then any address this router doesn't know, it sends it to the other site. THis has the disadvantage that if neither site knows the address the packet will bounce several times between the sites before it dies.

ip route

That's as far as I am going to type now, 'cos there is lots lots more. It would be better to introduce a dynamic routing protocol, but I have given you static routes just to get you started.

Kevin Dorrell



This Discussion