VLAN Queries.ip default-gateway

satishtechsatishtech Posts: 243Member
Created a VLAN on a 2960 switch and added two ports/hosts to the VLAN.Initially the Hosts were able to ping the gateway Router connected to the switch.After VLAN creation unable to ping gateway.I used the command ip default-gateway on the switch and changed the port connecting to the Router to trunk. Correct me if I am wrong. 1.Once VLAN's are created they become separate subnets. [In my case I have now two vlan's , the native vlan and one I created vlan 11] 2.Each VLAN needs its own separate gateway. 3.I need to configure subinterfaces on the router interface. [ I did configure works fine as long as there is no IP address overlapping ] what exactly would be the use of ip default-gateway ?


  • HP_GuyHP_Guy Posts: 77Member ■■■□□□□□□□
    Hmmm... good question. My guess would be if the switch itself needed to reach a different network (rather than a host connected to one of its vlans). For example, you're consoled into the switch and type ping google.com.
  • satishtechsatishtech Posts: 243Member
    ok thank you, also configured interVLAN on a L3 switch 3560, and connected a Router to the switch, now unable to ping the router interface connected to the switch. ! interface FastEthernet0/1 switchport access vlan 10 switchport mode access ! interface FastEthernet0/2 switchport access vlan 20 switchport mode access ! interface FastEthernet0/3 switchport access vlan 30 switchport mode access interface Vlan1 ip address ! interface Vlan10 ip address ! interface Vlan20 ip address ! interface Vlan30 ip address ! ip classless ip route ip route kindly correct what I am doing wrong.
  • satishtechsatishtech Posts: 243Member
    sorry about previous post,something wrong with my net connection, using a proxy to connect to this site ,cannot edit previous post . simple questions unable to ping a Router connected to a L3 Switch 3560 InterVLAN works fine.
  • nman99nman99 Posts: 35Member ■■□□□□□□□□
    All of those configs that you pasted, what device are those on, 3560, 2960 or this router your talking about ?

    1.Once VLAN's are created they become separate subnets. - Yes

    2.Each VLAN needs its own separate gateway. - Yes, because they are on different networks

    3.I need to configure subinterfaces on the router interface. - It depends, the switch that your hosts are connected to, do you want that to be l2 or l3? If you choose to make it a l3 switch and have the vlan gateways on the same switch then no, you would not need subinterfaces. If you wanted the vlan gateways to be hosted on the actual router, then yes you would need sub interfaces for each vlan on the router side, and switchport trunking setup on the switch side.

    4.What exactly would be the use of ip default-gateway- you could use this command on a layer 2 switch if you were trying to have remote access to it from a network other than the management network. Basically you would need this command to tell your l2 switch where to forward the management traffic when it is trying to send to a network outside of it's own. (It can't be used for routing user traffic). I stole the below example of using ip default-gateway from a post that Webmaster did back in 2006 on TE.

    "To be able to manage the switch using telnet, you will need to configure it with an IP address. Instead of assigning an IP address to one of the switch ports, we are going to assign an IP address to the Management VLAN.

    Use the following commands to assign the IP address to VLAN 1, which is the management VLAN by default:
    TEswitch1(config)#interface vlan 1
    TEswitch1(config-if)#ip address
    TEswitch1(config-if)#no shutdown

    If you need to be able to connect to the switch from other networks, you will also need to configure a default gateway address. For example, if the switch is connected to a router with the IP address, use the following command, in Global Configuration mode, to use it as the default gateway:
    TEswitch1(config)#ip default-gateway
    - Webmaster http://www.techexams.net/forums/ccnp/14693-ip-default-gateway-switch.html

    Hope this helps.
Sign In or Register to comment.