Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Route table creation problem - please help

Status
Not open for further replies.

cub2000

IS-IT--Management
Jan 15, 2005
4
US
I'm trying to create a route table on Solaris 9 sparc. The local machine has several IPs on different interfaces. One of them is 192.168.1.10 on interface dgc0:1. The remote host is xx.xx.xx.xx, gateway is 192.168.1.5, and the IP i want to use to go out to xx.xx.xx.xx is 192.168.1.10. That way, when the local machine goes to visit xx.xx.xx.xx via web, SSH, FTP, the logs on the remote machine will show 192.168.1.10 and not the IP of the primary interface.

I'm trying the command "route add -host xx.xx.xx.xx 192.168.1.5 -interface dgc0:1". It 's complaining that the value of "dgc0:1" is invalid.

Any help is appreciated,
Lucas
 
Have you created a /etc/hostname.dgc0:1 and entered the the node name in your host table.
 
Yes, they are there and when I type that command

# route add host xx.xx.xx.xx 192.168.1.5 -interface dgc0:1

It spits out the error:

dgc0:1: bad value


Any idea ?
 
can I see the output of (if you wish you can substitute IPs by AA.BB.CC.DD or eg. [subnet-A].10 in your posts)
netstat -rn
ifconfig -a
route get xx.xx.xx.xx

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Hi daFranze,
I am testing it on my local network at this point, so I don't mind posting the actual IPs I'm doing right now. As you can see down below, the source box has 3 IPs, 2 NICs, 1 public and 1 local 192.168.1.5. I want to use the IP 192.168.1.10 of the virtual device dgc0:1 to go to machine 192.168.1.6. That means, the destination machine 192.168.1.6 should have in its logs that the source machine comes via FTP, SSH, SFTP, Web, etc. has the IP of 192.168.1.10. Below is the output you requested. Thanks.


# netstat -nr

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.1.0 192.168.1.5 U 1 383 dgc0
192.168.1.0 192.168.1.10 U 1 0 dgc0:1
24.218.140.0 24.218.141.90 U 1 343 hme0
default 24.218.140.1 UG 1 7702
127.0.0.1 127.0.0.1 UH 2 17401 lo0


# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
dgc0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.1.5 netmask ffffff00 broadcast 192.168.1.255
ether 0:10:5a:14:55:9d
dgc0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.1.10 netmask ffffff00 broadcast 192.168.1.255
hme0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 3
inet 24.218.141.90 netmask fffffc00 broadcast 24.218.143.255
ether 8:0:20:a0:42:82





# route get 192.168.1.6
route to: luke
destination: 192.168.1.0
mask: 255.255.255.0
interface: dgc0
flags: <UP,DONE>
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
0 0 0 0 0 0 1500 0
 
routing is a first match search in the routing table

your destination 192.168.1.6 (subnetmask ff.ff.ff.00) matches the first line in your table
Code:
# netstat -nr

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
[b]192.168.1.0          192.168.1.5          U         1    383  dgc0[/b]
192.168.1.0          192.168.1.10         U         1      0  dgc0:1
24.218.140.0         24.218.141.90        U         1    343  hme0
default              24.218.140.1         UG        1   7702  
127.0.0.1            127.0.0.1            UH        2  17401  lo0

if there is a smaller subnet this would match first, so I suggest to add ether a static host route
#route add host 192.168.1.6 192.168.1.5 1
or create a new subnet eg 192.168.2.0 for these hosts
(There are dynamic length subnet masks available since Solaris 2.6 - I think - but I never worked with these, therefore you need to create a subnet within 192.168.1.0, maybe somebody knows more about this!?)

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top