03-31-2017 08:18 AM - edited 03-08-2019 10:00 AM
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?
03-31-2017 10:07 AM
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
04-01-2017 10:14 AM
Well, I am asking any possible solution /work around (if exists), or shall we try with L3 switch?
04-01-2017 12:40 PM
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
04-01-2017 12:55 PM
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
:-)
04-02-2017 10:47 PM
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 :(
04-03-2017 05:20 AM
Hi
In this case you can use VRF as it was mentioned previously. Can I know why you must use IP per port?
04-02-2017 11:43 PM
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.
04-03-2017 05:09 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide