Forum Discussion
Using a Static IP Address on a Raspberry Pi Connected to my Nighthawk Router
- Jun 30, 2020
schumaku wrote:So t the end of the day, what went wrong and broke the Pi <-> D7800 connection and the Internet connection finally?
The router was unaware of the presence of the Webserver, so didn't route Google traffic when I was trying to use the Static IP.
> [...] One of the Pi3s has been in place for three years and is running
> a Captive Portal and Webserver. [...]
I don't know what "Captive Portal" means to you, but I may not need
to.
> [...] This needs two Ethernet ports; eth0 connected to the Pis network
> [...]
You lost me. To make sense of this, I'd need a map showing what's
connected to what, including which IP addresses are used on which LAN
segments. So far, I'm not even sure how many routers you have. Or
where the Internet connection appears.
> [...] we are installing a VPN Server [...]
I know nothing about that, either. (Or VPNs, in general, for that
matter.)
The one piece of "/etc/dhcpcd.conf" which you exhibited looked ok to
me. If you're having trouble getting to the Internet that way, then I'd
worry more about the router configuration and the routes on the R-Pi
than on its basic IP configuration. Possibly interesting:
ifconfig
netstat -rn
Typically, if you're using multiple subnets, then someone needs more
routing info than a simple default route/gateway. Your main router, for
example.
> [...] AFAIK the subnet mask is defined by the /24 in the declaration.
Yes, as I said.
antinode wrote:I don't know what "Captive Portal" means to you, but I may not need to.
You lost me. To make sense of this, I'd need a map showing what's connected to what, including which IP addresses are used on which LAN segments. So far, I'm not even sure how many routers you have. Or where the Internet connection appears.
I know nothing about that, either. (Or VPNs, in general, for that matter.)
Typically, if you're using multiple subnets, then someone needs more routing info than a simple default route/gateway. Your main router, for example.
A Captive Portal is a software tool that directs Visitors logging on to a WiFi Network at an attraction and directs their device to particular content. It uses iptables to restrict or allow access to the Internet and yes, it does it by using routing tables.
Similarly, a VPN Server uses iptables to route traffic (amongst other things) and also is more than 'just any old Pi'. Many VPN Servers work by taking encrypted traffic off the Internet (via the Router) and then putting the clear traffic back out onto the same network. However, this won't work when the two networks are on different subnets, so the server has two Ethernet ports.
Whilst I appreciate your advice, don't you think you might be getting a little patronising? I asked one very clear question; how to set up a static IP Address when the Pi is connected to a Netgear Router. Having a diagram showing how I'm using the other side of the Pis, complete with IP Addresses is pretty irrelevant I would have thought and the fact that you know nothing about Captive Portals or VPNs doesn't help.