Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Problem understanding configuration of ip address!

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

6 REPLIES
Hall of Fame Super Blue

Re: Problem understanding configuration of ip address!

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

Hall of Fame Super Silver

Re: Problem understanding configuration of ip address!

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

New Member

Re: Problem understanding configuration of ip address!

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

Hall of Fame Super Blue

Re: Problem understanding configuration of ip address!

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

Hall of Fame Super Silver

Re: Problem understanding configuration of ip address!

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

Hall of Fame Super Silver

Re: Problem understanding configuration of ip address!

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

107
Views
0
Helpful
6
Replies