CCNA Video Training Series

Instant Access, Web or Mobile!

Only $99 for 30 days...
Renew at half price!

Buy/Renew

Includes FREE Practice Exams!

Member Login

Lost your password?

Not a member yet? Sign Up!

Official Lammle User Forum

Results 1 to 12 of 12
  1. #1
    Join Date
    Dec 2008
    Posts
    88

    Default VLAN IP vs. Default-Gateway

    Hey everyone,

    I had a question regarding the examples on Page 520/521 of Lammle 6th Ed.

    I am not clear on the difference between assigning an IP Address to a VLAN, and assigning a Default-Gateway to the switch.

    If we are assigning an IP Address to each VLAN, do we also need to configure a default-gateway on the switch?

    The IP Address assigned to the switch will be a unique IP to identify the VLAN, while the default-gateway will be the IP Address of the router.

    Page 521 says: If you want to manage your switch from outside your LAN, you need to set a default-gateway...

    Page 517 says: We're also assign an IP Address to each switch, but this isn't really necessary to make our network function. The only reason we're going to do that is so we can manage/administer it.

    Do we need to do both?

    Also, on Page 579 an IP Address was set for VLAN1. Would we also set one for VLAN2?

    Thanks!
    Last edited by typesh; 01-21-2009 at 02:47 PM.

  2. #2
    Join Date
    Mar 2008
    Location
    Winston Salem, NC
    Posts
    432

    Default

    You can assign ip addresses to vlans for two reasons.. 1) to management it remotely from telnet or ssh
    2) to make SVI and provide intervlan routing locally on the switch . (for layer 3 switches)

    for CCNA purposes, assign ip adddresses to vlans are for mangament purposes...for a layer 2 switch... Once you get into the CCNP level, you will learn how to create SVI and do intervlan routing.

    using the command Ip default-gateway is when your switch is a layer 2 switch, and doesnt provide routing functions, that way if it has a packet going to another network, it will send it to the default gateway... If the switch was a layer 3 switch, then it would just look into the routing table to figure out where to send the packet.. but since its a layer 2 switch, it will send it to its default gateway specified by the command "ip default-gateway.

    remeber, ip default-gateway is setup when there is no routing occuring on the switch ( layer 2 switch)

    for CCNA purposes , ip addresses assign for vlans are for management purposes.

    and yes, you can assign ip addresses for all the vlans, that way a host from that specific vlan or subnet can remotely manage the switch.
    Cisco---------------------- CompTIA
    -CCNA ----------------------Security +
    -CCNP (BSCI,BCMSN,ISC W)

  3. #3
    Join Date
    Dec 2008
    Posts
    88

    Default

    Quote Originally Posted by lildeezul View Post
    that way if it has a packet going to another network, it will send it to the default gateway...
    Thanks for your response.

    My confusion comes from thinking that Layer 2 switches purely deal with MAC Addresses and have nothing to do with IP Addresses.

    I thought that if the switch receives a packet and does not know what destination port to send it out, then it just broadcasts it to everyone...

    If we tell the switch:
    Switch(config)# ip default-gateway 192.168.1.1

    How does that help the switch since it deals solely with MAC Addresses and not IP Addresses?
    Last edited by typesh; 01-21-2009 at 03:18 PM.

  4. #4
    Join Date
    Mar 2008
    Location
    Winston Salem, NC
    Posts
    432

    Default

    When a switch recieve an unknown destination MAC, not packet or IP, it will flood traffic to all ports...


    If we tell the switch:
    Switch(config)# ip default-gateway 192.168.1.1

    How does that help the switch since it deals solely with MAC Addresses and not IP Addresses?
    Your forgetting the process of arp and routing...

    First off the PC will send out a arp broadcast asking for the mac for the destination, the switch will flood this broadcast, and the router (off one of the switches port) will recieve this broadcast, and say "hhmmm this destination is remote, and he needs send his traffic to me, so that i can route him there" so the router responds with his mac.. now the switch has the routers mac and the pc mac in the table.. The pc destination mac will be the mac address of the router , therefore the switch will look only at the layer 2 information and forward the data.... the router will strip off the layer 2 information ,and change it according to the next hop, or a recursive lookup on its part.


    The default gateway receives IP packets with unresolved destination IP addresses from the switch.
    Once the default gateway is configured, the switch has connectivity to the remote networks, with which a host needs to communicate.
    Cisco---------------------- CompTIA
    -CCNA ----------------------Security +
    -CCNP (BSCI,BCMSN,ISC W)

  5. #5
    Join Date
    Dec 2008
    Posts
    88

    Default

    Quote Originally Posted by lildeezul View Post
    First off the PC will send out a arp broadcast asking for the mac for the destination, the switch will flood this broadcast, and the router (off one of the switches port) will recieve this broadcast, and say "hhmmm this destination is remote, and he needs send his traffic to me, so that i can route him there" so the router responds with his mac.. now the switch has the routers mac and the pc mac in the table.. The pc destination mac will be the mac address of the router , therefore the switch will look only at the layer 2 information and forward the data.... the router will strip off the layer 2 information ,and change it according to the next hop, or a recursive lookup on its part..
    Doesn't this process still take place even if we don't assign an a Default-Gateway Address to the switch?

  6. #6
    Join Date
    Mar 2008
    Location
    Winston Salem, NC
    Posts
    432

    Default

    yes it does... hmmm i am trying to find a way to explain to you so that you can understand me better.

    ok... Lets say you want to remotely access a device from the switch your consoled to.. As you stated the switch deals with layer 2 address, therefore we need to apply the command IP default-gateway, so the switch knows where to send the telnet stream if the destination device we want to telnet into is on another network.. Its like a default route for the switch, becuase it doesnt have a ip routing table, becuase its a layer 2 switch..

    do you understand now.

    remember , the ip default-gateway command is only neccessary if not ip routing is being done on the switch.
    Cisco---------------------- CompTIA
    -CCNA ----------------------Security +
    -CCNP (BSCI,BCMSN,ISC W)

  7. #7
    Join Date
    Mar 2008
    Location
    Winston Salem, NC
    Posts
    432

    Default

    another way to look at this..

    take the following scenario

    A managed switch has to be accessed somehow. Switches that can be telnetted into, or have HTTP based management interface obviously need an IP address. If the switch and the host managing the switch are not on the same IP network, then the Telnet/HTTP packet has to be routed. In order for the switch to be able to send the response packets, it has to know where the router is to forward the packet to. That would be the default gateway.

    hope this helps,, sorry for not being clear earlier in the post
    Cisco---------------------- CompTIA
    -CCNA ----------------------Security +
    -CCNP (BSCI,BCMSN,ISC W)

  8. #8
    Join Date
    Dec 2008
    Posts
    88

    Default

    Thank you again for helping me out.

    I think I understand now...

    So it is necessary if we want to manage the switch from outside the LAN. Its purpose is so the switch knows where to send its responses. The switch would send its responses to the default-gateway, which would then be routed to wherever we are managing from.

    If we do not want to Telnet into the switch from a remote network, then we don't need to assign a default-gateway to the switch.

    Am I right...?

  9. #9
    Join Date
    Mar 2008
    Location
    Winston Salem, NC
    Posts
    432

    Default

    yes you are exactly right... the switch needs a way back to us for remote management
    Cisco---------------------- CompTIA
    -CCNA ----------------------Security +
    -CCNP (BSCI,BCMSN,ISC W)

  10. #10
    Join Date
    Dec 2008
    Posts
    88

    Default

    It all makes sense now! Thanks!!

  11. #11
    Join Date
    Jan 2009
    Posts
    1

    Default

    I realize I am reiterating some of what has already been said, but I think this might help:

    Since the switch only operates at the Data Link layer (layer 2) it doesn't ever NEED to deal with IP addresses while switching. The only reason to assign it an IP address is because the switch runs services above the Network layer (above layer 3) such as http and telnet (for management purposes) and since it cannot perform its own layer 3 routing, you need to specify a default route.

  12. #12
    Join Date
    Dec 2008
    Posts
    88

    Default

    Sounds good. Thanks for your reply as well!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. lab 11.4 Do we need to enter a default gateway address
    By duckieone in forum CCENT Chapter 11: VLAN’s and InterVLAN Routing
    Replies: 1
    Last Post: 01-08-2014, 12:36 PM
  2. Setting Default Gateway for PC's
    By jefss1 in forum Chapter 8: IP Routing
    Replies: 0
    Last Post: 06-24-2010, 04:42 PM
  3. ip route versus ip default-gateway
    By Nezmin2 in forum Routing
    Replies: 1
    Last Post: 05-23-2010, 07:27 AM
  4. Default IP Gateway query
    By milanchatterjee in forum TCP / IP
    Replies: 1
    Last Post: 12-16-2009, 09:19 AM
  5. Send to Default Gateway or ARP?
    By typesh in forum TCP / IP
    Replies: 14
    Last Post: 02-24-2009, 07:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •