LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to reload the routing table? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-reload-the-routing-table-800094/)

echorequest 04-05-2010 05:51 AM

How to reload the routing table?
 
Hi all,

I've simple question here on routing.
After making an changes (add/modify/delete) to /etc/static.routes, what command should we use to reload the routing table?

Any help would be appreciated.
Thanks in advance.

Germanchu 04-05-2010 07:43 AM

With iproute2, the command would be "ip route flush cache". Don't know how it can be done with the "route" command..

Best regards,

luck.anshu 04-05-2010 09:04 AM

best option is to restart network service by executing following command:
#service network restart

echorequest 04-06-2010 12:26 AM

Thanks Germanchu & luck.anshu for your reply..
Which of these command below can be used to reload the routing table?

route add –F /etc/static.routes
/etc/rc3.d/S94addroutes start
netstat –nvr /etc/static.routes
/etc/netmasks –reload

GrapefruiTgirl 04-06-2010 12:36 AM

Looks like the OP needs to do a little more Googling, as this sure sounds like homework, and all the answers to questions like this are very easily answerable without having to ask others to answer them for you.

You also haven't even told us what operating system you're even referring to either (though usually teaching courses are centered around RHEL or CentOS, are they not?) -- and at least one of the commands shown above, does not even apply to a good number of OS's.

If this is not homework, then please provide more detail about what you're trying to accomplish, what Linux you're using, what you've tried so far, and show the output of the commands you have tried, including any error messages.

If this *is* homework, you'll do yourself a big favor by doing it yourself, and referencing the course material provided for you.

Kind regards,
Sasha

Skaperen 04-06-2010 08:14 AM

Quote:

Originally Posted by luck.anshu (Post 3924845)
best option is to restart network service by executing following command:
#service network restart

Beware if doing this via an SSH session. If things change in certain ways, the session may get disconnected. And the SIGHUP from that may cause the command to be interrupted, leaving you without access. If you must connect by the network to do it, run the command within a screen session to avoid the SIGHUP effect.


All times are GMT -5. The time now is 07:02 PM.