cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
397
Views
5
Helpful
3
Replies

Communicating to a router from a VLAN

Ibbywannit
Level 1
Level 1

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.

3 Replies 3

Kevin Dorrell
Level 10
Level 10

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 192.168.10.254 255.255.255.0

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

Luxembourg

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?

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 192.168.42.1 255.255.255.252

and the same thing at the other end, but make it 192.168.42.2. 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 192.168.10.0 is at the other site, then introduce:

ip route 192.168.10.0 255.255.255.0 192.168.42.2

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 0.0.0.0 0.0.0.0 192.168.42.2

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

Luxembourg

Review Cisco Networking for a $25 gift card