×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

Two subnets with different mask on a single router?

Unanswered Question
Mar 13th, 2014
User Badges:

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!

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Jon Marshall Thu, 03/13/2014 - 15:39
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

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

Jon Marshall Thu, 03/13/2014 - 15:47
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

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

HerrMartell Thu, 03/13/2014 - 15:54
User Badges:

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.

Jon Marshall Thu, 03/13/2014 - 16:02
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

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

HerrMartell Thu, 03/13/2014 - 16:12
User Badges:

>>> 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!

Jon Marshall Thu, 03/13/2014 - 16:29
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

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

milan.kulik Fri, 03/14/2014 - 03:16
User Badges:
  • Red, 2250 points or more

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

Actions

This Discussion

Related Content