Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

Two subnets with different mask on a single router?

router 1941

 

Hello. I'm needing assistance with the setup of two subnets within a single router.

 

Here's my information:

 

Router has only two GigabitEthernet interfaces.

GigabitEthernet0/0 has 172.20.0.1 ip and 255.255.252.0 mask.

GigabitEthernet0/1 has 172.21.0.1 ip and 255.255.128.0 mask

Now, on each side there is a Switch with two computers.

 

I need to have 1 computer on each side on the same subnet, and the other one on a different subnet, meaning a pc on the same side cannot communicate with the other computer on its side, but can with another computer on the other side.

 

I have no idea how to configure this on the router, can anyone please help me?

 

Thanks in advance!

Everyone's tags (1)
7 REPLIES
Hall of Fame Super Blue

Not sure i understand.Do you

Not sure i understand.

Do you mean you have -

PC1                                                            PC3

          SW1 -> gi0/0  router gi0/1 -> SW2

PC2                                                            PC4

where PC1 and PC3 are in the same subnet and PC2 and PC4 are in a different subnet.

If so this isn't going to work because you cannot route to the same subnet ie. PC1 cannot route to the same subnet through the router.

However if the above is what you want a much easier solution is to just use one switch and then you could make it work.

Perhaps you can clarify if the above is what you want and if it is can you just use one switch ?

Jon

Hall of Fame Super Blue

Just to say, you could use

Just to say, you could use both switches but they would need to connected to each other with a trunk link.

Again this assumes the above is what you are trying to do.

Jon

New Member

The topology you described is

The topology you described is correct.

 

PC1 & PC3 are on the same mask.

PC2 & PC4 are on the same mask.

 

In all, they are using two different subnet masks.

 

Problem is, each interface can only have 1 mask. So two pcs could communicate, but not 4 of them.

 

I need it with this topology, I heard I could use static routes to do this.

 

Hope this helps helping me.

 

And thanks.

Hall of Fame Super Blue

So you want PC1 and PC3 to be

So you want PC1 and PC3 to be able to talk to each other but you don't want them to be able to talk to PC2 and PC4 and vice versa.

Is the above correct ?

If so you don't need a router, you can just a switch (or switches)  and  use two vlans with no L3 interfaces.

Do you need these PCs to be able to communicate with other devices ie. not the PCs listed but other devices ?

Please clarify exactly what you are trying to do because i can't see from your description why you need a router.

Jon

New Member

>>> So you want PC1 and PC3

>>> So you want PC1 and PC3 to be able to talk to each other but you don't want them to be able to >>>talk to PC2 and PC4 and vice versa.

This is correct.

>>>If so you don't need a router, you can just a switch (or switches)  and  use two vlans with no L3 >>>interfaces.

Unfortunately they are not giving me the choice of making my own net design. I need to setup this with all the devices mentioned (1 router, 2 switches, 4 pcs).

>>>If so you don't need a router, you can just a switch (or switches)  and  use two vlans with no L3 >>>interfaces.

As long as they communicate with the appropiate PC, it doesnt matter if they communicate to other devices or not.

 

Thanks again!

Hall of Fame Super Blue

Unfortunately they are not

Unfortunately they are not giving me the choice of making my own net design. I need to setup this with all the devices mentioned (1 router, 2 switches, 4 pcs).

Please don't take this the wrong way but is this a homework type test because the above makes no sense otherwise. You don't setup networks having to use certain equipment whether it is needed or not, you just setup the network using what is needed.

Jon

Hi, is this some kind of a

Hi,

 

is this some kind of a school excercise?

 

IMHO, you could make all 4 PCs communicating following way:

Let's say the PCs are having IP addresses

172.20.0.2

172.20.0.3

172.21.0.2

172.21.0.3

And the PCs with .3 Ip addresses are placed on the "wrong" router side (behing the interface assigned to the other subnet).

 

In that case you could configure:

ip route 172.20.0.3 255.255.255.255 GigabitEthernet0/1

ip route 172.21.0.3 255.255.255.255 GigabitEthernet0/0

You aslo need proxy arp enabled on both interfaces:

int GigabitEthernet0/0

ip proxy-arp

int GigabitEthernet0/1

ip proxy-arp

 

In this case all 4 PCs will be able to communicate each to the others (even without default GW configured).

If you want to block some communication between the PCs on the same router side, e.g., you will need to apply some ACL though, I'm afraid.

 

Best regards,

Milan

181
Views
0
Helpful
7
Replies
CreatePlease to create content