On Sun, May 17, 2009 at 01:13:29AM +0200, Felipe Alfaro Solana wrote:
> Hi misc,
> route add allows one to specify a directly-connected route reachable over an
> interface, using the -interface switch. However, I can't seem to figure out
> if it's possible to specify just the interface name to the -interface
> switch. According to the manual page, only an IP address is allowed:
> 
> """
>      If the destination is directly reachable via an interface requiring no
>      intermediary system to act as a gateway, the -interface modifier should
>      be specified; the gateway given is the address of this host on the
> common
>      network, indicating the interface to be used for transmission.
> """
> 
> The thing is the interface I want to use with the -interface switch does not
> have a static IP address. I could script something to get the current IP
> address of that interface but looks hacky to me. Is it possible to do
> something like?
> 
> # route add -net 128.0.0.0/16 -interface vr2
> 
> instead in OpenBSD? I'm a little bit confused since adding the route while
> using the IP address yields the following entry in the routing table:
> 
> 128.0/16           link#3             UCS        0        0     -     8 vr2
> 
> So, why is exactly that -interface wants an IP address but does not like
> interface names?
> 

ifconfig vr2 alias 128.0.0.1/16

This will ensure that everything is correctly set up.
Doing it with route will most probably cause issues because it will not
setup everything correctly. You need an IP on that interface in that
network or it will not work.

-- 
:wq Claudio

Reply via email to