2

I have 2 interfaces on Solaris box

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 192.168.1.41 netmask ffffff00 broadcast 192.168.1.255
        ether x:x:x:x:x:x
hme1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.1.42 netmask ffffff00 broadcast 192.168.1.255
        ether x:x:x:x:x:x 

# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.1.0          192.168.1.41         U         1     91  hme0
192.168.1.0          192.168.1.42         U         1      0  hme1
224.0.0.0            192.168.1.41         U         1      0  hme0
default              192.168.1.1          UG        1     91  
127.0.0.1            127.0.0.1            UH        1      0  lo0

hme0 the default interface but i want to specify host 192.168.1.32 to use interface hme1. i try to use

route add 192.168.1.32 192.168.1.42 -interface hme1

but return

hme1: bad value

any idea how can i solve it?

conandor
  • 229
  • 4
  • 7
  • 19

5 Answers5

2

It seem all giving replies only applicable on Linux platform.

However on Solaris 10, the command which I found it to be work:

route -p <add/delete> <hostname> <gateway> -ifp <interface>
conandor
  • 229
  • 4
  • 7
  • 19
1

l1x's solution is correct, but it has some problems; other hosts on the hme0 side don't be able to reach 192.168.1.32, and 192.168.1.32 might not be able to reach those other hosts.

If this is a problem, it's because your netmasks say that 192.168.1.* is connected to both networks, which isn't true. Perhaps you want to do this without subnets and set the mask to 255.255.255.255 which would allow you to create routes without the -interface line.

Perhaps you can use 192.168.2.* for one side, and route the other, although you'd need access to create the route on the router, or reconfigure all of the machines on your 192.168.1.* network to know about this route.

If you can't do either of these things, you might be able to create a bridge.

If you're not afraid to patch your kernel and load alpha-quality drivers, you can make an Ethernet Bridge (also see RBridge).

If an IP-only solution would be adequate, you can use proxy arp and IP forwarding to make a crude IP-only bridge. Start with something like this:

arp -s 192.168.1.32 macaddress-of-hme0 pub
route add 192.168.1.32 secretip
ndd -set /dev/ip ip_forawrding 1

Under Solaris, proxy_arp is really broken. The only reliable way to do it is to give the machine 192.168.1.32 an additional secret IP address, such as 10.5.3.2 that you only use for this.

,-----,         hme1,-----,   hme0
|hostA|-------------|hostB |----------- ?
`-----'             `-----'
192.168.1.32        192.168.1.41
10.5.3.2            192.168.1.42
                    10.5.3.1

Although, in this configuration, "hostB" doesn't require both 192.168.1.41 and 192.168.1.42.

geocar
  • 2,317
  • 14
  • 10
0

This would the command on Solaris 10:

route add 192.168.1.32 192.168.1.42 -interface

You don't need to add the interface name after the argument -interface because the IP address 192.168.1.42 is already implicitly saying to use hme1.

Regards,

-1

Try this: route add -net 192.168.1.0 -netmask 255.255.255.0 -interface 192.168.1.42

-1

The solaris route syntax is the follewing:

route [-fn] add | delete | get [net|host|default] [destination] [gateway]

So you command looks like this:

route add 192.168.1.32 -interface hme1
Istvan
  • 2,582
  • 3
  • 22
  • 29
  • i enter the command "# route add 192.168.1.32 -interface hme1" yet i still get the error message "hme1: bad value" – conandor Sep 04 '09 at 01:49