1

I configure two same subnet network(ip:192.168.0.2 & ip:192.168.0.3) into VLAN...so they wont communicating with each other...but now i want them to communicate with each other...

For that i connected my switch to a router but with a single same subnet (ip:192.168.0.1).. For both system i had given the default gateway as (ip:192.168.0.1) and also trunk the gateway coming from router to switch but still they are not communicating with each other.. For different subnet mask this strategy works...but for same subnet it is not happening.. I just want to know why it is not happening or i am doing something wrong??

1
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Commented Dec 25, 2018 at 9:06

3 Answers 3

1

If you want to remove the "barrier" between the VLANs just reconfigure the ports to use the same VLAN ID.

As Ron's pointed out, a router is required to enable communication between two VLANs (=distinct L2 segments). In your case that isn't possible as both VLANs use the same IP subnet - you'd need to renumber one of the subnets (or use a highly awkward source and destination NAT).

Routing doesn't work with identical (or overlapping) subnets because a sending node consults its local routing table, finds that the destination is on the local subnet and tries to ARP the destination IP address. Failing that (since the destination is in another broadcast domain), transmission fails altogether. Static ARP entries won't help either as distinct VLANs do not communicate directly, ie. on the L2.

0

Routers route packets between networks, not from a network back to the same network. You cannot assign the same or overlapping networks to two different router interfaces. The router will need an interface for each VLAN, but because the VLANs have the same network, you could not configure the two router interfaces with the same network. Routing must be deterministic, but a router would have no idea where to send a packet if it had two interfaces with the same network.

1
  • You should say "You cannot assgn the same networks to two different router interfaces on a cisco router". Some routers do allow it.
    – JFL
    Commented Jul 23, 2018 at 7:58
-2

I take issue with the people claiming this is not possible, i don't know if it is possible on cisco gear but it is certainly possible in general.

There are a few problems we need to deal with.

  1. The router needs to know which interface each destination is on. When you assign an IP and subnet to each interface it implicitly creates a route but you now have two routes for the same destination, only one of them will end up actually getting used.
  2. The clients need to send the traffic to the router. Normally clients choose to send traffic to a router based on the subnet mask but that isn't going to work here.
  3. Apparently some routing platforms forbid such configurations.

Point 1 can be solved by adding explicit routes to tell the router which interface each end system is on.

Point 2 can be solved by using proxy arp.

Point 3 is simply a matter of choosing a routing platform that doesn't have such artificial restrictions. For example Linux.

Here is a worked example of such a setup on Linux, I will use three network namespaces to represent the router and the two clients.

#create virtual Ethernet interfaces
ip link add veth0 type veth peer name veth1
ip link add veth2 type veth peer name veth3

#create network namespaces
ip netns add clienta
ip netns add clientb
ip netns add router

#put interfaces into network namespaces
ip link set veth0 netns clienta
ip link set veth1 netns router
ip link set veth2 netns router
ip link set veth3 netns clientb

#clienta configuration
ip netns exec clienta ifconfig lo up
ip netns exec clienta ifconfig veth0 192.168.0.2/24 up
ip netns exec clienta ip route add default via 192.168.0.1

#clientb configuration
ip netns exec clientb ifconfig lo up
ip netns exec clientb ifconfig veth3 192.168.0.3/24 up
ip netns exec clientb ip route add default via 192.168.0.1

#router interfaces
ip netns exec router ifconfig lo up
ip netns exec router ifconfig veth1 192.168.0.1/24 up
ip netns exec router ifconfig veth2 192.168.0.1/24 up

#tell the router where each client is 
ip netns exec router ip route add 192.168.0.2 dev veth1
ip netns exec router ip route add 192.168.0.3 dev veth2

#now the router can ping the clients (but they can't ping each other yet)
ip netns exec router ping 192.168.0.2
ip netns exec router ping 192.168.0.3

#enable routing on the router
echo 1 | ip netns exec router sponge /proc/sys/net/ipv4/conf/all/forwarding

#for the clients to ping each other we also need the proxy arp
#we could enable generic proxy arp but that is a very dangerous option, better to
#only proxy the things we actually need to proxy
ip netns exec router ip neigh add proxy 192.168.0.3 dev veth1
ip netns exec router ip neigh add proxy 192.168.0.2 dev veth2

#now the clients can ping each other
ip netns exec clienta ping 192.168.0.3
ip netns exec clientb ping 192.168.0.2

#traceroute shows we are actually routing
ip netns exec clienta traceroute -n 192.168.0.3
ip netns exec clientb traceroute -n 192.168.0.2
5
  • 1
    Note that the question is tagged Cisco.
    – JFL
    Commented Jul 22, 2018 at 12:26
  • 1
    VRF is not "in general". There is absolutely no logical reason to build a network in such an insane manner. ('tho I have seen people -- who know nothing about networking -- create this mess for themselves.)
    – Ricky
    Commented Jul 23, 2018 at 0:54
  • I was using the network namespaces to demonstrate/test the setup without needing to use three real machines, they are not a fundamental part of the soloution. Commented Jul 23, 2018 at 1:36
  • the solution is not practical but you have a solution and it is Appreciated. Commented Jul 23, 2018 at 4:28
  • Inter-Vlan routing is not feasible with same subnets . Commented Dec 3, 2020 at 7:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.