cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1006
Views
5
Helpful
8
Replies

Catalyst Switch (L2) and IP address

amh4y0001
Level 3
Level 3

Hi,

Is there a way that we can assign each port a unique IP address with same subnet mask?

Even I created vlans and tried to assign ip address to vlan, I got message that it overlaps with the other vlan.

In my specific situation, I must use the same subnet mask.

Example : Ip address : 192.168.1.xx 255.255.255.224 

Port 1 : 192.168.1.100 255.255.255.224 

Port 2 : 192.168.1.101 255.255.255.224 

Port 30 : 192.168.1.130 255.255.255.224 

Possible somehow?

8 Replies 8

Reza Sharifi
Hall of Fame
Hall of Fame

Hi,

You can't assign the same IP subnet to multiple vlan interfaces (SVIs).  Each vlan needs to have its own segment.

example:

this does not work

Inter vlan 10

ip address 192.168.1.1 255.255.255.0

Inter vlan 20

ip address 192.168.1.2 255.255.255.0

This works:

Inter vlan 10

ip address 192.168.1.1 255.255.255.0

Inter vlan 20

ip address 192.168.2.1 255.255.255.0

HTH

Well, I am asking any possible solution /work around (if exists), or shall we try with L3 switch?

With a L2 switch not possible. With a L3 switch, well the example Reza gave is with a L3 switch and still the answer is no unless you use VRFs ie. each port would be in it's own VRF and then you can use overlapping IPs.

Whether or not that is a solution for you is impossible to say because you haven't told us what the problem is :)

Jon

Hi 

I agree with Jon and Reza, the problem is that you are overlapping the subnet between port 1 and 2, port 3 is part of the other network segment

Port 1 : 192.168.1.100 255.255.255.224    it belongs to the network segment: 192.168.1.96/27

Port 2 : 192.168.1.101 255.255.255.224   it belongs to the network segment: 192.168.1.96/27

Port 30 : 192.168.1.130 255.255.255.224  it belongs to network segment 192.168.1.128/27

You cannot have 2 or more IP addresses associated to the same network segment, unless you are using /32 with loopbacks, or secondary argument example:

interface loopback 0
ip add 192.168.1.100 255.255.255.255

interface loobpack 1
ip add 192.168.1.101 255.255.255.255

or using secondary argument, like:

vlan 10

interface vlan 10
ip add 192.168.1.100 255.255.255.224
ip add 192.168.1.101 255.255.255.224 secondary
no shutdown

Please rate the comments if they were useful

:-)




>> Marcar como útil o contestado, si la respuesta resolvió la duda, esto ayuda a futuras consultas de otros miembros de la comunidad. <<

Thanks guys for contribution.

Unfortunately, I have to assign static IPs /port with same subnet. If I have 10 IPs and I create 10 vlans, (one IP / vlan), it still overlaps :(

Hi

In this case you can use VRF as it was mentioned previously. Can I know why you must use IP per port?




>> Marcar como útil o contestado, si la respuesta resolvió la duda, esto ayuda a futuras consultas de otros miembros de la comunidad. <<

Jon can you elaborate on what is exactly mean by:

unless you use VRFs ie. each port would be in it's own VRF and then you can use overlapping IPs.

With VRFs you can have separate routing and forwarding tables so you can reuse the same IP and subnet masks if you want to. But that means that each VRF cannot see the other VRFs which may or may not be what you want.

You can leak routes between VRFs but because you are using the same subnet that wouldn't be possible as far as I know.

Jon

Review Cisco Networking for a $25 gift card