Your syntax is wrong, as pointed by Juan you have missed -net while deleting the route.
Correct syntax is
If you look at the output of netstat -nr.
The flag G means the route was added with -net option [-net Force the destination to be interpreted as a network], hence in order to delete it you must specify -net while deleting otherwise it will always say not in table.
I need to delete a file located at some other Unix server. Can it be done in a Shell script where I pass it the login and password and it should not prompt me for the same?
and it should not prompt me for the same?
thanks
dharmesh (1 Reply)
Hi Guys,
I am currently working on a script to find all the files that have not been accessed for the past 2 years. This, i guess has been discussed n number of times in this forum. Now, my requirement is to find all the files in the remote windows server. I have it mounted in unix.
I... (1 Reply)
I'm trying to use my Gentoo Linux home workstation for connecting to a Windows RAS callback server through analogic telephone line (PSTN).
I'm using pppd and successfully configured pppd's options and chat files, both for the outgoing call and for receiving the incoming callback. All seems going... (20 Replies)
how r u all,
i have AIX server which is kerberised, and i create a user on it called "sam"
when i want to assign a password for it i typed smit user then i choosed change password and i choosed the user " sam" when i press enter this message ' user 'sam' doesnt exist" appears.
then when i want... (2 Replies)
Hi
I just started learning Unix scripts.
I need to access an FTP server, delete all the files except the latest 6 files and the latest 6 files should be downloaded to my local server. Could some body help me to code this logic in KSH ?
Thanks
Athena (1 Reply)
Hi,
I am involved in a project on Debian. One of my requirement is to route an IP packet in my application to a proxy server and receive the reply from the proxy server as an IP packet. My application handles data at the IP frame level. My application creates an IP packet(with all the necessary... (0 Replies)
Hi guys,
sorry for asking noob question.
When do we really need to add a static route on the server?
I encounter this situation whereby a client trigger a network packet to the destination but the destination does not know how to return the traffic back to the client (source).
The issue was... (4 Replies)
Just want to know if someone has a clue about what could be happening here:
I have an AIX box with four NICs in Ether channel connected to a Cisco Switch.
When I try to ping the default gateway, sometimes it works, but sometimes it doesn't work unless it has a defined static route.
Thanks... (1 Reply)
Hi All,
Let me know how can i find and delete files from one unix server to another unix server which are 'N' days older.
Please note that I need to delete files on remote unix server.So, probably i will need to use sftp, but question is how can i identify files and folders which are 'N'... (2 Replies)
Solaris 10
I am trying to delete a route using the command:
route -p delete 192.0.0.0 192.1.3.254
The route gets delete but for some reason the route pops back up in the routing table after reboot. I also deleted the /etc/inet/static_routes file and the route still persists after reboot.... (6 Replies)
Discussion started by: jastanle84
6 Replies
LEARN ABOUT BSD
route
ROUTE(8) System Manager's Manual ROUTE(8)NAME
route - manually manipulate the routing tables
SYNOPSIS
/sbin/route [ -f ] [ -n ] [ command args ]
DESCRIPTION
Route is a program used to manually manipulate the network routing tables. It normally is not needed, as the system routing table manage-
ment daemon, routed(8), should tend to this task.
Route accepts two commands: add, to add a route, and delete, to delete a route.
All commands have the following syntax:
/sbin/route command [ net | host ] destination gateway [ metric ]
where destination is the destination host or network, gateway is the next-hop gateway to which packets should be addressed, and metric is a
count indicating the number of hops to the destination. The metric is required for add commands; it must be zero if the destination is on
a directly-attached network, and nonzero if the route utilizes one or more gateways. If adding a route with metric 0, the gateway given is
the address of this host on the common network, indicating the interface to be used for transmission. Routes to a particular host are dis-
tinguished from those to a network by interpreting the Internet address associated with destination. The optional keywords net and host
force the destination to be interpreted as a network or a host, respectively. Otherwise, if the destination has a ``local address part''
of INADDR_ANY, or if the destination is the symbolic name of a network, then the route is assumed to be to a network; otherwise, it is pre-
sumed to be a route to a host. If the route is to a destination connected via a gateway, the metric should be greater than 0. All sym-
bolic names specified for a destination or gateway are looked up first as a host name using gethostbyname(3N). If this lookup fails, get-
netbyname(3N) is then used to interpret the name as that of a network.
Route uses a raw socket and the SIOCADDRT and SIOCDELRT ioctl's to do its work. As such, only the super-user may modify the routing
tables.
If the -f option is specified, route will ``flush'' the routing tables of all gateway entries. If this is used in conjunction with one of
the commands described above, the tables are flushed prior to the command's application.
The -n option prevents attempts to print host and network names symbolically when reporting actions.
DIAGNOSTICS
``add [ host | network ] %s: gateway %s flags %x''
The specified route is being added to the tables. The values printed are from the routing table entry supplied in the ioctl call. If the
gateway address used was not the primary address of the gateway (the first one returned by gethostbyname), the gateway address is printed
numerically as well as symbolically.
``delete [ host | network ] %s: gateway %s flags %x''
As above, but when deleting an entry.
``%s %s done''
When the -f flag is specified, each routing table entry deleted is indicated with a message of this form.
``Network is unreachable''
An attempt to add a route failed because the gateway listed was not on a directly-connected network. The next-hop gateway must be given.
``not in table''
A delete operation was attempted for an entry which wasn't present in the tables.
``routing table overflow''
An add operation was attempted, but the system was low on resources and was unable to allocate memory to create the new entry.
SEE ALSO intro(4N), routed(8), XNSrouted(8)4.2 Berkeley Distribution November 16, 1996 ROUTE(8)