cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4439
Views
0
Helpful
5
Replies

Two network segment on the same switch (no vlan), possible?

Why can't 2 or more network segment work on same switch (without VLAN configuration)? It seems like switch should learn MAC addresses for each interface then work but what when I try to connnect two network segment (different network id ex.192.168.1.0 and 172.16.1.0), a lot of (or all) requests are timed out. Why? Should switch igore network id because it is layer2? I know that this might be a stupid question but I kind of confuse. Thank you

5 Replies 5

mheusinger
Level 10
Level 10

Hi,

it should be possible, but you need a router for connectivity or maybe a small trick.

Let us assume you have a host A 192.168.1.10/24 and another host B with 172.16.1.5/24 connected to one switch (or in one VLAN, which would give the same result).

When you f.e. ping 172.16.1.5 from host A, it will first consult its internal routing table ("route print" on a MS host). As the destination address is not local it would not send any packet unless there is a default gateway, because otherwise no route to the destination is known. The same applies to host B, when you try to reach host A. So one possible solution is installing a router and setting it to be the default gateway. Example config:

host A

IP 192.168.1.10

Mask 255.255.255.0

GW 192.168.1.1

host B

IP 172.16.1.5

Mask 255.255.255.0

GW 172.16.1.1

interface FastEthernet0

ip address 192.168.1.1 255.255.255.0

ip address 172.16.1.1 255.255.255.0 secondary

The router will get the IP packet from host A and forward it to host B and vice versa, which results in connectivity.

Another possibility is to modify the routing tables of host A and B.

host A

IP 192.168.1.10

Mask 255.255.255.0

GW 192.168.1.10

host A

IP 172.16.1.5

Mask 255.255.255.0

GW 172.16.1.5

The small trick here is that both hosts have their own IP as default gateway. This will result in host A sending an ARP for host Bs MAC, when you execute f.e. ping 172.16.1.5

As long as those ARPs are successful - and they finally should, because the switch would deliver them being OSI layer broadcasts to all ports - connectivity should be given.

Regarding your specific network problem with timed out connection attempts, I do not know your specific configuration (hosts, router), so it is hard to tell, what is going on. If you can reveal your settings it should be possible to find a solution.

Hope this helps! Please rate all posts.

Regards, Martin

What I was trying is that,

I have one switch(Catalyst2948G) and 4 computer, 2 for each networks: Computer A,B is in 192.168.1.0/24, Computer C,D is in 172.16.1.0/24

Let's say the switch is not capible of doing VLAN.

When I tested ping computers in the same network (ie. from computer A to B and C to D), I got network drops. That's why I'm confused.

But when I did create VLANs for the two network to make it seperate, it works fine. No timed out anymore.

With out VLAN, why it didn't work?

Hi,

hard to tell.

A port on a Cisco switch is always in a VLAN. Without config this will be VLAN 1 (factory default).

It is more than unlikely to find a network problem without configuration and more details - in your case also about host config.

In addition it would help to see interface counters and error log messages.

So be happy that everything works - or create the errored condition again and provide more information. As the latter would degrade your network service I personally would never do that and also do not recommend you to do that.

Regards, Martin

IMO, I also did not find any problem to use two separated subnets in same L2 switch. It is quite strange.

Did you configure the switch w/ IP and configure GW at host to point to it ? If yes, it may the problem. Just a wild guess.

Agreed w/ Martin, if it works now, just let it go unless you have a lab to test it and VLAN cannot be implemented in your network.

Hi Jackyoung

You said "IMO, I also did not find any problem to use two separated subnets in same L2 switch". Is there something different if it is L3 or multi-leyer switch?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: