Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

5 Answers 5

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.

share|improve this answer
up vote 1 down vote accepted

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>
share|improve this answer

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,

share|improve this answer

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
share|improve this answer
    
i enter the command "# route add 192.168.1.32 -interface hme1" yet i still get the error message "hme1: bad value" –  conandor Sep 4 '09 at 1:49

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.