Basic Solaris static routing

Hi All, :(:confused:

I have scoured the web and can't find this anywhere.

What I am trying to do is set up a static route through an available gateway on a server, and then test connectivity through TELNET.

I have done this on AIX (I already had this procedure).
On AIX I would use SMIT. In this example I had the following info.

Destination IP: 167.210.153.38
Default Gateway: 130.103.18.1
Net Mask: 255.255.254.0
Network Interface: 130.103.19.158

So using SMIT I created this command, which could be run via cmd line:

chdev -l inet0 -a route=net, -hopcount, 0, -netmask, 255.255.254.0, -if, en0,,,,167.210.153.38, 130.103,18.1

then after the static route is set up:

# telnet 167.210.153.38

would give a response to prove it worked.

        • *

Now, I just have to do the same thing on a number of Solaris boxes.

I assume the best approach would be to add a line to /etc/gateways, something like:

net 167.210.153.38/255.255.254.0 gateway 130.103.19.158 metric 0 passive

Since I have no SMIT or interface tool I can use, I am pretty much limited to having to figure out exactly where everything is supposed to be first shot.

Does anyone know how to this?

Thanks much

I am not sure how exactly to get the available gateway information on Solaris.
For example if I do this on Solaris:

# netstat -in

I get:

Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 127.0.0.0 127.0.0.1 57935224 0 57935224 0 0 0
fjgi0 1500 159.202.145.128 159.202.145.244 28530586 0 3954426 0 0 0
fjgi4 1500 192.168.40.0 192.168.40.55 15371263 0 9248059 0 1657923 0
hme0 1500 130.103.18.0 130.103.19.190 5747738 0 8868158 0 0 0

Whereas on AIX, if I do netstat -in, I would get:

Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
en0 1500 link#2 6e.c.50.1.f0.4 5273447 0 3880490 0 0
en0 1500 130.103.18 130.103.19.234 5273447 0 3880490 0 0
en1 1500 link#3 6e.c.50.1.f0.5 8294404 0 6688212 0 0
en1 1500 192.168.145 192.168.145.129 8294404 0 6688212 0 0
en1 1500 159.202.145 159.202.145.237 8294404 0 6688212 0 0
en1 1500 159.202.145 159.202.145.252 8294404 0 6688212 0 0
lo0 16896 link#1 5431023 0 5437550 0 0
lo0 16896 127 127.0.0.1 5431023 0 5437550 0 0
lo0 16896 ::1 5431023 0 5437550 0 0

Where I imagine I can see en0 having 130.103.18.1 as an available gateway. (I don't have this problem on AIX, because I can just get it out of SMIT)

Is there anywhere where anyone has ever written this down?
Surely if Solaris proves to be a real pain, there will be less of them in our future.

Thanks for any help.

for routes use the file /etc/inet/routes... view routes with:

"netstat -rn"

hth,
DN2

DukeNuke,

This file is blank on my Solaris box.
I am unclear as to what you mean.
Do you mean use /etc/inet/routes in place of /etc/gateways?

Is there a writeup on this procedure anywhere in cyberspace as to how to do it?

Surely people learned this from somewhere.

http://www.unix.com/sun-solaris/33304-adding-routes-in-solaris.html

>>>>

enter the routes in the file /etc/inet/routes like this:

net "network" "router"

example:
net 192.168.0.0/24 192.168.0.254

hth,
DN2

>>>>

I hate to enervate the point, but I still can't tell from that how one translates the output of the 'netstat -in' command to an entry for this line.

For example: (# netstat -in)

Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
lo0 8232 127.0.0.0 127.0.0.1 57935224 0 57935224 0 0 0
fjgi0 1500 159.202.145.128 159.202.145.244 28530586 0 3954426 0 0 0
fjgi4 1500 192.168.40.0 192.168.40.55 15371263 0 9248059 0 1657923 0
hme0 1500 130.103.18.0 130.103.19.190 5747738 0 8868158 0 0 0

I am guessing wildly here. If my destination address to static route TO is 167.210.153.38, then it looks to me like the available gateway I want is 130.103.18.0.
I don't see any en0 interface like there was on the AIX box, but I do recognize the 130.103.18 prefix, which I saw dozens of on the AIX side using SMIT (if I saw 130.103.20.0 for instance, that would be the available gateway I would use).

So the line I would enter would be:

net 130.103.18.1/255.255.255.0 167.210.153.38

or

net 130.103.18.1/255.255.254.0 167.210.153.38

Depending on what the network mask is.
I know that 255.255.255.0 can be expressed simply as '24':

http://www.ingate.com/files/422/fwmanual-en/xa11944.html

At that point I would assume a

# telnet 167.210.153.38 60000

Would respond if it worked.
But I am not sure how one gets the correct network mask needed to place in this file from the output above.

? ? ?

Okay, the command is netstat -rn, not nestat -in.

I will learn how to do a static route, if it's the last thing I do in this job.
Beware, networking gurus! Your ivory tower is under siege, and the idiots are coming.

And unless I'm shot in the back by my contracting overlords, I'm making it in