1

I have a block of IPs a /24 which i have subnetted into 2 /25s. In the first block one of my clients is requesting I give him 3 x /28 and 1 x /30. Subnetting is not an issue. My concern is how do I tell those blocks of IP's that I will subnet to him to use the x.x.x.1 as their default gateway when they are in different subnets to the default gateway. The setup is 1 router with a cable running to a 48 port switch and all servers and users are supposed to connect to that switch.

3
  • 1
    You can't do this. If you are subnetting then the default gate IP can't be in a different subnet range now can it? That was the point in subnetting :)
    – Baldrick
    Commented Apr 30, 2014 at 11:31
  • A gateway is the host on the network that knows how to reach other networks. you would need a gateway to get to a gateway on a different network. In essence, the gateway must be on the same network as the device using the gateway.
    – Ron Maupin
    Commented Aug 8, 2017 at 18:10
  • 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 could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 10, 2017 at 3:45

3 Answers 3

3

Have you considered using VLANs and sub-interfaces?

A sub-interface is an interface that uses your physical interface for moving data. That way you can create "multiple networks" in your network by creating the amount of sub-interfaces.

interface fa 0/0
encapsulation dot1q 10
ip address 192.168.0.1 255.255.255.0
no shutdown

interface fa0/0.1
encapsulation dot1q 20
ip address 192.168.1.1 255.255.255.0
no shutdown

The 'encapsulation dot1q [number]' is to tell your interface to which VLAN it should be listening. In this case either VLAN 10 or 20.

This way you would have 2 VLANs which would seperate your network; but they would be able to use the same physical default gateway.

I hope I understood your question correctly!

2
  • so in other words I will have to create Vlans in the switch. And create another default gateway using a sub interface?
    – user5462
    Commented Apr 29, 2014 at 15:40
  • Yes. Create the VLANs and just give the gateway IP-address to your (sub-)interfaces.
    – Joren
    Commented Apr 29, 2014 at 22:07
2

AFAIK, i don't think you can do that.

The gateway IP tells the system how to get to another subnet, and without it, packets won't leave the current subnet.

A computer only knows how to talk to the other computers that are directly connected on the same subnet. A gateway is a "default route" which specifies where packets should be sent by default if they are not destined for somewhere on the local subnet.

Here :

1
  • Indeed. One cannot set x.1 as a gateway if it isn't within a connected subnet. (or you've added a route to it: route 192.168.1.1 255.255.255.255 f0/0)
    – Ricky
    Commented Apr 29, 2014 at 17:53
1

You can't do this. The gateway is an interface which is on the same subnet as the interface a packet is forwarded on. When a host wants to forward a packet, it will look at the destination address and use the netmask to determine if the destination is on the same subnet or a different one.

If the destination subnet is the same, the sending host will forward the packet to the destination at layer 2. If the destination subnet is different, it will forward the packet to the gateway at layer 2. Either the destination host must be local or a local gateway must be known. You can't have a non-local gateway.

3
  • Eh, I'd go with "you could, but it's a really bad idea". Proxy-arp MIGHT be able to work around his issue, but proxy-arp is a really, really bad idea.
    – nicotine
    Commented Apr 29, 2014 at 14:12
  • ProxyARP solves a different problem, one in which the gateway's address is local but the interface is not in the same broadcast domain. If the network is 192.168.1.128/25, ProxyARP still won't allow a host to use 192.168.1.1 as the gateway. Commented Apr 29, 2014 at 14:21
  • 1
    Actually, proxy-arp would work, but you should never go there. (there wouldn't be a gateway address, just an interface... route 0.0.0.0 0.0.0.0 f0/0)
    – Ricky
    Commented Apr 29, 2014 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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