Problem understanding configuration of ip address!

Unanswered Question
Nov 17th, 2008

Hi

I'm having a problem understanding how to assign an ip address to a switch ethernet interface (6509). I could do the config in two ways i.e:

Method 1:

conf t

interface Vlan 10

ip address 10.50.1.20 255.255.255.0

exit

interface gigabitethernet 1/46

switchport

switchport mode access

switchport access vlan 10

exit

Method 2:

conf t

interface gigabitethernet 1/46

ip address 10.50.1.20 255.255.255.0

exit

Whcih way is the correct way? Also If I go with method 2 how do I know which vlan the port is in?

Thanks

Dan

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Jon Marshall Mon, 11/17/2008 - 07:37

Dan

With method 2 the port is not in a vlan - it is a routed port. By the way you should add "no switchport" under gi1/46 in method 2.

Both are valid and correct ways. You would typically use method 1 when you had a vlan with clients/servers/printers in it.

You would typically use method 2 where you may want to connect the 6500 to another L3 switch and or router and you wanted the link to be a L3 routed link.

Jon

Richard Burts Mon, 11/17/2008 - 07:42

Dan

I do not believe that we can say that 1 is the "correct" way, at least not without knowing more about your environment and what your requirements are.

Either of these might be "correct" depending on the situation. Method 2 in which you assign the address directly to the switchport is appropriate when the port is a direct connection to another layer 3 routed device and will create a point to point routed subnet. In this configuration the switchport is not a member of any VLAN, it is just part of a routed subnet.

Method one where you put the switchport into a vlan and assign the IP address to the VLAN is most appropriate when there may be several members of the subnet and you want the address associated with a vlan and not effectively a point to point routed connection.

HTH

Rick

dan_track Mon, 11/17/2008 - 08:35

HI,

Thanks all for the replies.

I don't have a particular problem it was more of a query that came into my mind. If I imagine a separate router plugged into a switch the connection in the switch will always reside in a particular vlan, why doesn't this case hold up in a multilayered switch?

Thanks

Dan

Jon Marshall Mon, 11/17/2008 - 08:45

Dan

I have configured setups where a router was connected into a L3 switch where both ends were configured as routed ports. The L3 switch exchanged routes for all it's vlans over the L3 link to the router.

If it is a L2 switch only then you have to put the router port into a vlan because you have no choice as L2 switches do not support routed ports.

However on a L3 switch you have the choice and as i said it depends on what you want to do. So for example if you were designing an access-layer that connected to the distro layer via L3 i would rather use routed ports on both ends than vlans and a L2 link. Major advantage is with L3 link you are not running STP across it.

Jon

Richard Burts Mon, 11/17/2008 - 08:49

Dan

I think that you need to think again about your statement: "a separate router plugged into a switch the connection in the switch will always reside in a particular vlan". If you are referring to a layer 2 switch then you are absolutely correct. But in dealing with layer 3 switches that is not necessarily true. As Jon and I have pointed out if you configure the switch interface with no switchport and configure an IP address then the connection from the router to the switch is a routed connection and is not a member of any VLAN.

HTH

Rick

Richard Burts Mon, 11/17/2008 - 08:53

Dan

To respond to the part of your answer that you were not facing a particular issue but it was more of a general querry, I think that the right answer is that either approach can be correct. And that the choice of which one is more appropriate depends on the particular situation.

HTH

Rick

Actions

This Discussion