LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   route add (https://www.linuxquestions.org/questions/linux-networking-3/route-add-296576/)

robf2301 03-02-2005 12:36 AM

route add
 
I have a route add for a windows workstation:
route add 11.128.97.252 mask 255.255.255.255 10.128.97.2 -p

I cannot get this working on Linux.

Can anybody help convert this to a Linux form please?

Cheers
Rob

nonzero 03-02-2005 01:29 AM

From man route

route add -net 127.0.0.0
adds the normal loopback entry, using netmask 255.0.0.0 (class
A net, determined from the destination address) and associated
with the "lo" device (assuming this device was prviously set up
correctly with ifconfig(8)).

route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
adds a route to the network 192.56.76.x via "eth0". The Class C
netmask modifier is not really necessary here because 192.* is
a Class C IP address. The word "dev" can be omitted here.

route add default gw mango-gw
adds a default route (which will be used if no other route
matches). All packets using this route will be gatewayed
through "mango-gw". The device which will actually be used for
that route depends on how we can reach "mango-gw" - the static
route to "mango-gw" will have to be set up before.

route add ipx4 sl0
Adds the route to the "ipx4" host via the SLIP interface
(assuming that "ipx4" is the SLIP host).

route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
This command adds the net "192.57.66.x" to be gatewayed through
the former route to the SLIP interface.

route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
This is an obscure one documented so people know how to do it.
This sets all of the class D (multicast) IP routes to go via
"eth0". This is the correct normal configuration line with a
multicasting kernel.

route add -net 10.0.0.0 netmask 255.0.0.0 reject
This installs a rejecting route for the private network
"10.x.x.x."

'man' try it you'll like it!!

nz

Who greatly resisted the 'RTFM' response.

robf2301 03-02-2005 07:18 AM

I did look at 'man'. I came up with this:
route add -host 11.128.97.252 gw 10.128.96.2

and that doesn't work!

Cheers
Rob

nonzero 03-02-2005 08:51 PM

The output of my kernel routing table using route and netstat -ree.

[nonzero@blacky /]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default dslrouter 0.0.0.0 UG 0 0 0 eth1

[nonzero@blacky / ]# netstat -ree
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0 0 0 0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1 0 0 0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1 0 0 0
default dslrouter 0.0.0.0 UG 0 0 0 eth1 0 0 0

Now we need a little more info on your setup. Is your network using static or dynamic IP's? Do you have a Windows based firewall setup on this network and how is it configured? Does your windows network allow TCP/IP connections or is it strictly NETBIOS i.e. 'Windows Network'?

nz

EDIT: Also why are you using route add -host instead of route add -net?

robf2301 03-08-2005 11:18 PM

Mostly dynamic IPs. Servers will normally have a static IP though.

Windows based firewall, yes. Just checking to see if my IP isn't perhaps blocked.

All TCP/IP.

I'm using -host because this is just one machine on the 11.* network and our administrators are very particular about who accesses it and how.

Cheers
Rob

vusa 03-09-2005 01:10 AM

Was it a mistake that you put 10.128.97.2 in your first post and 10.128.96.2 in the other for your gateway? How's your network setup, because you say it's the only machine on the 11.* network, how does it network then with the others? There has to b another machine on the same subnet with it to act as it's "gateway" to the rest of the network. Or I'm getting lost...?

robf2301 03-11-2005 04:06 AM

Yep, sorry. It is ...96.2.

Some very expensive routing hardware is used and in some rare cases 2 network cards in the same machine.


All times are GMT -5. The time now is 10:14 PM.