VLAN Queries.ip default-gateway

satishtechsatishtech Member Posts: 243
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 ?

Comments

  • HP_GuyHP_Guy Member Posts: 77 ■■■□□□□□□□
    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 Member Posts: 243
    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 172.16.1.1 255.255.0.0 ! interface Vlan10 ip address 192.168.1.9 255.255.255.248 ! interface Vlan20 ip address 192.168.1.17 255.255.255.248 ! interface Vlan30 ip address 192.168.1.33 255.255.255.248 ! ip classless ip route 192.168.1.0 255.255.255.0 192.168.1.1 ip route 0.0.0.0 0.0.0.0 172.16.1.1 kindly correct what I am doing wrong.
  • satishtechsatishtech Member Posts: 243
    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 Member Posts: 35 ■■□□□□□□□□
    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 192.168.1.254 to VLAN 1, which is the management VLAN by default:
    TEswitch1(config)#interface vlan 1
    TEswitch1(config-if)#ip address 192.168.0.9 255.255.255.0
    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 192.168.1.254, use the following command, in Global Configuration mode, to use it as the default gateway:
    TEswitch1(config-if)#exit
    TEswitch1(config)#ip default-gateway 192.168.0.254
    "
    - Webmaster http://www.techexams.net/forums/ccnp/14693-ip-default-gateway-switch.html

    Hope this helps.
Sign In or Register to comment.