Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
SSH into a server (In this case a Pi running Raspbian) after a new wireless modem was installed on a home network far far away. The new modem (A PK5001Z) runs on a default gateway of 192.168.0.1 whereas the old one ran on 192.168.1.1 . The modem's gateway was temporarily changed to enable you to get into the server and make the necessary changes to the interfaces file. Upon restarting the server you realized that in your haste you had neglected to change the static IP that had been previously been assigned to the server.
In other words after a moment of sheer brilliance my interfaces file now has a default gateway of 192.168.0.1 and a static IP of 192.168.1.x
I have no physical access to the server to pull the SD card, and my only way of communicating with the network is through the web interface of the modem (No other accessible machines on the network)
Yes, I could have just changed the gateway on the new modem and left well enough alone. I didn't, however, and am wondering if there is any possible configuration change I can make to the modem (via DHCP addressing etc...) that might give me access to the server and make things right.
A gateway outside a connected (sub)network is an invalid TCP/IP configuration, as I'm sure you know. You have three options:
Have the router NAT inbound connections behind 192.168.1.1. That way, the PI will see the incoming connection as originating from a local IP, and won't have to use a gateway at all.
Send ICMP redirects to the PI, telling it that the (public/external) IP address you're connecting from can be reached via 192.168.1.1. Unless the TCP/IP stack on the PI is configured to ignore redirects, that should cause an IP route to be added to the routing table.
Flood the PI with gratuitous ARPs for 192.168.0.1, in the hope that it will fool the IP stack into recognizing 192.168.0.1 as a local IP.
Options 2 or 3 may not be feasible, unless you have low-level access to the OS on the modem/router. Option 1, however, may very well be possible to implement.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.