Inter vlan routing

shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
Hi guys,have currently been struggling a bit with inter vlan routing and wondered weather you could clear one thing up for me?

I Have set my pc's with the correct ip addresses and default gateways,set trunking on my switch using dot1 q encappsulation and createated the right sub interfaces on my router for the 2 vlans i have created on my switch.

My question is the only way i can get to ping from one pc to the other is if i use a routing protocol on the router like rip and advertise the networks,have i set everything up right because i was led to believe that you did not need to advertise the networks as they are directly connected?

Thanks for any help,Shaun
Oh no iv'e got brain freeze again!

Comments

  • phantasmphantasm Member Posts: 995
    Which router and switch are you using?
    "No man ever steps in the same river twice, for it's not the same river and he's not the same man." -Heraclitus
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Sorry,im using a 2650 router and a 2924 switch

    Thanks
    Oh no iv'e got brain freeze again!
  • bighornsheepbighornsheep Member Posts: 1,506
    Jack of all trades, master of none
  • cisco_troopercisco_trooper Member Posts: 1,441 ■■■■□□□□□□
    shaunebop wrote:
    Hi guys,have currently been struggling a bit with inter vlan routing and wondered weather you could clear one thing up for me?

    I Have set my pc's with the correct ip addresses and default gateways,set trunking on my switch using dot1 q encappsulation and createated the right sub interfaces on my router for the 2 vlans i have created on my switch.

    My question is the only way i can get to ping from one pc to the other is if i use a routing protocol on the router like rip and advertise the networks,have i set everything up right because i was led to believe that you did not need to advertise the networks as they are directly connected?

    Thanks for any help,Shaun

    Did you create vlan interfaces on your router? It is not enough to have the VLANs defined. You must also define the layer 3 interface and give it an IP address within the subnet you have defined for those VLANs.
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Yes i created the subinterfaces on the router and used dot1q encapsulation and assigned them to the correct vlan.
    It all works as it should if i advertise the networks using rip but if i dont it just wont seem to work?
    Oh no iv'e got brain freeze again!
  • bighornsheepbighornsheep Member Posts: 1,506
    shaunebop wrote:
    Yes i created the subinterfaces on the router and used dot1q encapsulation and assigned them to the correct vlan.
    It all works as it should if i advertise the networks using rip but if i dont it just wont seem to work?

    Please read the cisco document, you don't need to implement a routing protocol.
    Make sure the switchport is configured as a trunk.
    If your native vlan isn't vlan 1, you will need to specify that with your subinterface configuration as well.
    Jack of all trades, master of none
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Cheer's for the document,i tried configuring everythink exactly to that document at the weekend,but no joy.

    My native vlan is 1 and i have the switchport configured as a trunk?

    This one's really doing my head in icon_twisted.gif
    Oh no iv'e got brain freeze again!
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Here is the router config if this helps?
    Cheer's

    version 12.3
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname Router
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no network-clock-participate slot 1
    no network-clock-participate wic 0
    no aaa new-model
    ip subnet-zero
    !
    !
    !
    ip cef
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    interface FastEthernet0/0
    no ip address
    duplex auto
    speed auto
    !
    interface FastEthernet0/0.1
    encapsulation dot1Q 1 native
    ip address 192.168.100.49 255.255.255.240
    !
    interface FastEthernet0/0.2
    encapsulation dot1Q 2
    ip address 192.168.100.17 255.255.255.240
    !
    interface FastEthernet0/0.3
    encapsulation dot1Q 3
    ip address 192.168.100.33 255.255.255.240
    !
    ip http server
    ip classless
    !
    !
    !
    !
    !
    !
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    login
    !
    !
    !
    end
    Oh no iv'e got brain freeze again!
  • bighornsheepbighornsheep Member Posts: 1,506
    interface FastEthernet0/0.1
    encapsulation dot1Q 1 native
    ip address 192.168.100.49 255.255.255.240
    !
    interface FastEthernet0/0.2
    encapsulation dot1Q 2
    ip address 192.168.100.17 255.255.255.240
    !
    interface FastEthernet0/0.3
    encapsulation dot1Q 3
    ip address 192.168.100.33 255.255.255.240 
    

    Code looks good, just remember that PCs in VLAN 1 needs to have 192.168.100.49 /28 as the DG, and make sure you set a mask of /28
    PCs in VLAN 2 needs 192.168.100.17 /28 as DG
    PCs in VLAN 3 needs 192.168.100.33 /28 as DG

    It's a 2924 switch right? on the port that is trunking, do a show int <int #> switchport, make sure that it's actually trunking VLANs 1, 2, 3 to the router.

    on that switchport, check to make sure you have:
    switchport mode trunk
    switchport trunk allow vlan 1,2,3
    switchport trunk encap dot1q
    
    Jack of all trades, master of none
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Here is the switch config guys.

    Im not sure what you mean by setting the mask/28 ?
    Maybe this is where im going wrong?
    Anyway,thanks for all your help so far :D
    version 12.0
    no service pad
    service timestamps debug uptime
    service timestamps log uptime
    no service password-encryption
    !
    hostname Switch
    !
    !
    !
    !
    !
    !
    !
    ip subnet-zero
    !
    !
    controller LongReachEthernet 0
    !
    controller LongReachEthernet 1
    !
    controller LongReachEthernet 2
    !
    controller LongReachEthernet 3
    !
    controller LongReachEthernet 4
    !
    controller LongReachEthernet 5
    !
    controller LongReachEthernet 6
    !
    controller LongReachEthernet 7
    !
    controller LongReachEthernet 8
    !
    controller LongReachEthernet 9
    !
    controller LongReachEthernet 10
    !
    controller LongReachEthernet 11
    !
    controller LongReachEthernet 12
    !
    controller LongReachEthernet 13
    !
    controller LongReachEthernet 14
    !
    controller LongReachEthernet 15
    !
    controller LongReachEthernet 16
    !
    controller LongReachEthernet 17
    !
    controller LongReachEthernet 18
    !
    controller LongReachEthernet 19
    !
    controller LongReachEthernet 20
    !
    controller LongReachEthernet 21
    !
    controller LongReachEthernet 22
    !
    controller LongReachEthernet 23
    !
    !
    interface FastEthernet0/1
    switchport trunk encapsulation dot1q
    switchport mode trunk
    !
    interface FastEthernet0/2
    switchport access vlan 2
    !
    interface FastEthernet0/3
    !
    interface FastEthernet0/4
    !
    interface FastEthernet0/5
    !
    interface FastEthernet0/6
    !
    interface FastEthernet0/7
    !
    interface FastEthernet0/8
    switchport access vlan 3
    !
    interface FastEthernet0/9
    !
    interface FastEthernet0/10
    !
    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
    !
    interface VLAN1
    ip address 192.168.100.50 255.255.255.240
    no ip directed-broadcast
    no ip route-cache
    !
    ip default-gateway 192.168.100.49
    !
    line con 0
    transport input none
    stopbits 1
    line vty 5 15
    !
    end
    Oh no iv'e got brain freeze again!
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Forgot to mention the default-gateways are set correctly on the pc's
    I know you mean a 28 bit subnetmask but i dont know where or what i need to set it on?
    Oh no iv'e got brain freeze again!
  • bighornsheepbighornsheep Member Posts: 1,506
    This thread is turning into a hand holding exercise. How are you assigning IP addresses to your PCs? are you running DHCP? or simply configuring static addresses?

    An ip address contains the address portion AND a subnet mask portion, when you assign a PC in vlan 2 the address 192.168.100.18 for example, you have to put the proper subnet mask to match the addressing scheme for that vlan, since you are using 255.255.255.240, that's a /28 in CIDR notation, in other words, for a PC in vlan 2 this is a sample configuration:
    IP address: 192.168.100.18
    subnet mask: 255.255.255.240
    default gateway: 192.168.100.17

    I'm going to let someone else do the kindness if you are still having problems, not sure what else I can clarify for you.

    good luck.
    Jack of all trades, master of none
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Cheer's ,The pc's are set correctly,just misinterprited what you ment.

    Thanks for your help guys and if anyone else has any ideas why i have to advertise these networks to get inter vlan routing to work i would much appreciated it.
    Oh no iv'e got brain freeze again!
  • dtlokeedtlokee Member Posts: 2,378 ■■■■□□□□□□
    A routing protocol will have no effect on a network with only one router. The only thing I can imagine would be the hosts are configured to run rip also and are getting routing information from the router in that configuration which would mean the default gateways, ip addresses, or subnet masks are incorrectly set on the hosts. Do the hosts have more than one adapter or more than one default gateway specified? Did you put in the correct mask (255.255.255.240) on the hosts? Can you ping the hosts default gateway? Can you ping the default gateway on the remote subnets?
    The only easy day was yesterday!
  • shaunebopshaunebop Member Posts: 29 ■□□□□□□□□□
    Thanks dtlokee,I am running a wireless nic on one of the pc's as well and as soon as i switched it off wwwwwwwhhhhhhhhhheeeeeeeeyyyyy it all works perfect.

    Thanks so much everyone icon_lol.gif
    Oh no iv'e got brain freeze again!
Sign In or Register to comment.