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.
I was just notified by my data center that I need to change the gateway on my RH servers by Monday. I know how to do this if I had direct access to the servers, unfortunately they are 1500 miles away. How can I ssh to the servers and make the change? What are the commands?
You can delete the default route with:
route del 0.0.0
Then add with:
route add 0.0.0.0 gw ip.of.new.gateway
Note that removing the default route will probably mean losing your connection, there are 2 possibiliies:
1) Stick the commands in a script and run it with your fingers crossed
2) Add an explicit route back to yourself using the old gateway, make the default change, then once you have confirmed it is working you can remove the extra route.
You can create a route back with:
route add -host your.source.ip.addr gw ip.of.current.gateway
Then just swap add for del to remove it later. Remember not to remove it until you are sure that it can see out via the other gateway, you could test this using lynx or wget:
lynx http://www.linuxquestions.org
wget -qO - http://www.google.com
If you can reach them then it is probably safe enough to delete the other route back to yourself.
I know these are really basic questions, but I don't want to have to run to the airport in the morning and fly to Atlanta if I screw up. LOL
route add -host your.source.ip.addr gw ip.of.current.gateway
(When you say "your.sourse.ip.addr" that's my DHCP assigned ip address here on my home machine, right?)
Then I:
Delete the default route with:
route del 0.0.0
(is this "0.0.0" or the old gateway ip address)
Then add with:
route add 0.0.0.0 gw ip.of.new.gateway
(again "0.0.0.0" or does that represent the new gateway IP?)
your.sourse.ip.addr should be the internet/public ip address of the machine you connect as - you should see it when you login to your server and run "who -u"
I would only delete the default route if you are sure you have added the route back to yourself (if you have the IP right and your connection is still alive the it has more than likely worked) if you lose your connection then you should be able to login from any other machine on the internet and set the right route, if you have a dynamic public IP address then just force a refresh.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.