When you set route with route command, it sets temporary and restarting network service will brush up all your temporary set routes.
In case of linux, permanent static routes are added on a per interface basis in files located in the /etc/sysconfig/network-scripts directory. The filename format is route-interface-name so the filename for interface wlan0 would be route-wlan0.
The format of the file is quite intuitive with the target network coming in the first column followed by the word via and then the gateway's IP address. In our routing example, to set up a route to network 10.0.0.0 with a subnet mask of 255.0.0.0 (a mask with the first 8 bits set to 1) via the 192.168.1.254 gateway, we would have to configure file /etc/sysconfig/network-scripts/route-wlan0 to look like this:
Quote:
#
# File /etc/sysconfig/network-scripts/route-wlan0
#
10.0.0.0/8 via 192.168.1.254
Note: The /etc/sysconfig/network-scripts/route-* filename is very important. Adding the wrong interface extension at the end will result in the routes not being added after the next reboot. There will also be no reported errors on the screen or any of the log files in the /var/log/ directory.
You can test the new file by running the
You can try this too..
- nilesh
I have a Unix box with 2 network interfaces on the same IP subnet and would like to add a host route via a specific interface. Any assistance would be greatly appreciated. (3 Replies)
Ok, I made changes to my routing tables..... which file do I modify to make the routes initialize correctly when the machine boots up? I work with all flavours of Unix/Linux... but this is an older box...
Linux, Release 2.2.14-5.0.
I did a grep for the default route in /etc, but didnt find... (2 Replies)
Hi All,
I have a AIX server running v5.2 and its having multiple default routes configured to two seperate gateway.
Here's the output of -- netstat -rn
Routing tables
Destination Gateway Flags Refs Use If PMTU Exp Groups
Route Tree for Protocol Family 2... (2 Replies)
Hi there
When adding a route (or indeed deleting a route) which file is amended ? I am moving a box from one network to another and when it starts up it tries to connect run 'add net 192.x.x.x' etc etc ...but i dont want it to do that
where do I edit these route additions
cheers (5 Replies)
Solaris Guru's
What is the proper way to add routes in the routing table so after a node reboot the routes will not be lost.
I understand the /etc/defaultrouter for the default router
and the <route add> command but using this command routes will be removed once the node reboots.
Thanks (7 Replies)
Dear all,
I am totally despaired and puzzled.
Using Filezilla under Windows under the same network as our Linux servers is working. Using FTP command-line client under any of our Linux debian servers is not working ! I tried with different FTP servers -> same problem !
All commands are... (12 Replies)
I have 2 computers, from now on i shall call these computers A and B.
Made a live linux distro (bodhi) on A which has 1GB internal memory , because windows is unstable on B, which has 512MB internal memory.
I mean with memory the internal memory of the computer, not the memory of the usb... (0 Replies)
Hi All,
Is there a quick way to check whether the current routes on my centos are
persistent or not before rebooting ?
i can take a route -n output but i may completely lost access to my server if the routes are gone.
thanks. (1 Reply)
Hello,
I am on a Mac and trying to clean up some monthly files with a very simple SED:
sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt
(from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file)
then output to output.txt
Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies
LEARN ABOUT OSF1
gateways
gateways(4) Kernel Interfaces Manual gateways(4)NAME
gateways - Specifies Internet routing information to the routed daemon
SYNOPSIS
/etc/gateways
DESCRIPTION
The /etc/gateways file identifies gateways for the routed daemon. Ordinarily, the routed daemon queries the network and builds routing
tables. The routed daemon builds the tables from routing information transmitted by other hosts directly connected to the network. How-
ever, there may be gateways that this command cannot identify through its queries. These unidentified gateways are known as distant gate-
ways. Such gateways should be identified in the /etc/gateways file, which the routed daemon reads when it starts.
The general format of an file entry in the /etc/gateways file is: Destination Name1 gateway Name2 metric Value Type
The following is a brief description of each element in an /etc/gateways file entry: A keyword that indicates whether the route is to a
network or to a specific host. The two possible keywords are net and host. The name associated with Destination. Name1 can be either a
symbolic name (as used in the /etc/hosts or /etc/networks file) or an Internet address specified in dotted-decimal format. An indicator
that the following string identifies the gateway host. The name or address of the gateway host to which messages should be forwarded. An
indicator that the next string represents the hop count to the destination host or network. The hop count, or number of gateways, from the
local network to the destination network. A keyword that indicates whether the gateway should be treated as active, passive, or external.
The three possible keywords are as follows: An active gateway is treated like a network interface. That is, it is expected to exchange RIP
(Routing Information Protocol) routing information. Information about it is maintained in the internal routing tables as long as it is
active and is included in any routing information that is transmitted through RIP. If it does not respond for a period of time, the route
associated with it is deleted from the internal routing tables. A passive gateway is not expected to exchange RIP routing information.
Information about it is maintained in the routing tables indefinitely and is included in any routing information that is transmitted
through RIP. An external gateway is identified to inform the routed daemon that another routing process will install such a route and that
alternative routes to that destination should not be installed. Information about external gateways is not maintained in the internal rout-
ing tables and is not transmitted through RIP.
Note that these routes must be to networks.
EXAMPLES
To specify a route to a network through a gateway host with an entry in the gateways file, enter: net net2 gateway host4 metric 4 passive
This example specifies a route to a network, net2, through the gateway host4. The hop count metric to net2 is 4, and the gateway is
treated as passive. To specify a route to a host through a gateway host with an entry in the gateways file, enter: host host2 gate-
way host4 metric 4 passive
This example specifies a route to a host, host2, through the gateway host4. The hop count metric to host2 is 4, and the gateway is
treated as passive. To specify a route to a host through an active Internet gateway with an entry in the gateways file, enter: host
host10 gateway 192.100.11.5 metric 9 active
This example specifies a route to a specific host, host10, through the gateway 192.100.11.5. The hop count metric to host10 is 9 and
the gateway is treated as active. To specify a route to a host through a passive Internet gateway with an entry in the gateways
file, enter: host host10 gateway 192.100.11.5 metric 9 passive
This example specifies a route to a specific host, host10, through the gateway 192.100.11.5. The hop metric count to host10 is 9
and the gateway is treated as passive. To specify a route to a network through an external gateway, enter a line in the following
format: net net5 gateway host7 metric 11 external
This example specifies a route to a network, net5, through the gateway host7. The hop count metric to net5 is 11 and the gateway is
treated as external (that is, it is not advertised through RIP, but is advertised through an unspecified routing protocol).
RELATED INFORMATION
Daemons: gated(8), routed(8) delim off
gateways(4)