0

I'm trying to give a static address to a router but it gives an error saying:

Invalid gateway IP address

when I put the Ethernet cable directly into the laptop and give the same IP settings, it works fine (just the gateway IP is shown with a yellow color).

The settings are:

  • IP: 192.168.123.XXX
  • Subnet mask: 255.255.255.0
  • Gateway: 192.168.120.1

How can I get this working?

2
  • These settings are provided by college and are working for everyone who is directly using internet by lan wire. Nov 12, 2016 at 6:07
  • 2
    Those settings are obviously incorrect. You would need a gateway to reach your gateway! Nov 12, 2016 at 8:48

2 Answers 2

0

It appears your IP address and gateway are on different subnets.

Try using a subnet mask of 255.255.252.0. This will get them on the same subnet.

The reason I have suggested this is based on my assumption that your subnet mask is incorrect. I looked at your IP address and gateway and calculated a subnet mask that could be the correct one.

1

You either have an incorrect gateway address, or you have an incorrect network mask. A gateway is the host address on your network to which traffic is sent when the destination address is on a different network, so the gateway address must be on the same network as your host address.

A host on a LAN sends frames to another host on the LAN directly using the layer-2 address (usually a MAC address). If the destination layer-3 address (usually an IP address) is on a different LAN, then the frames are sent to the gateway layer-2 address. The layer-2 address is obtained using an ARP request, which is a broadcast, so it is confined to the current LAN. If your gateway is on a different LAN, you cannot get its layer-2 address, so you cannot send the frames to the gateway.

Your host will mask both your layer-3 address and the destination layer-3 address, and if the results are equal, the destination is local to the LAN, and the host uses ARP to get the layer-2 address. If the results are not equal, the host uses ARP to get the layer-2 address of the gateway. A host cannot get the layer-2 address of a gateway on a different LAN.

I suspect your error stems from the fact that you are confusing the WAN and LAN addresses. You should probably use DHCP from the WAN to assign the WAN addressing for your router. Your local DHCP server is for your LAN, not the WAN, and it needs to assign your router's LAN address as the gateway to your hosts. Your LAN gateway needs to be in the same network as you have assigned to your LAN router.

2
  • Thanks for answering @Ron, I didn't get much but it whatever I got it felt that you are right. 😊 Nov 12, 2016 at 9:22
  • but whatever I* Nov 12, 2016 at 9:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .