No Internet on AP, after static ip is given

device works properly in dhcp mode, but after giving static ip , device can't access to internet?

You also need to provide a valid gateway and dns.

1 Like

I assume we're talking about the wan interface?? Please confirm.

Is your router connecting directly to the internet, or is there another router upstream?

  • if you're router directly connects to the internet, you can only use static IP if your ISP provides this option.
  • In some cases, ISPs provide "static IPs" that are actually more like DHCP reservations and therefore they require a DHCP configuration on your router (this is easier for most users while meeting the goal of providing static IPs).
  • In all cases, as @trendy stated, you need to have a valid gateway and dns (and you also need to have the correct subnet mask).
    • If you are directly connected to the internet, your ISP will provide the gateway and subnetmask to you (often the DNS is provided, too, but you can use other DNS servers if you choose).
    • If you're connecting to an upstream router, you need to make sure the address you use is outside the DHCP pool and is not being used by any other devices. The gateway will be the address of the upstream router (and usually you can use the same address for DNS), and your subnet mask must match the size of that upstream network. The IP obviously must be in the correct subnet for the upstream router, and the lan subnet on your OpenWrt router must not overlap the upstream network.
1 Like