[gentoo-user] Setting up a route through a point-to-point interface

2005-05-12 Thread Jim Hatfield
Scenario: using vtun to build a Lan-to-Lan VPN.
One end FreeBSD, one end Linux.

On the BSD box I can set up a route directly through the tun0
device without having to assign it an IP address, like this:

 ifconfig tun0 up mtu 1450 -arp
 route add 192.168.10.0/24 -interface tun0

and it works just fine. On Linux (I've tried Gentoo and Redhat)
it would seem that the following should work:

 ifconfig tun0 up mtu 1450 pointopoint
 route add -net 192.168.10.0/24 dev tun0

However I get a:
SIOCADDRT: No such device

which suggests that the tun device doesn't support the right
ioctl variants.

Has anyone done this? It's easy enough to do it using throw-away
IP addresses for the two ends of the tunnel, but it's neater if
they can be avoided.

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] Setting up a route through a point-to-point interface

2005-05-12 Thread Pshem Kowalczyk
On 12/05/05, Jim Hatfield [EMAIL PROTECTED] wrote:

{cut}

  ifconfig tun0 up mtu 1450 pointopoint
  route add -net 192.168.10.0/24 dev tun0
 
 However I get a:
 SIOCADDRT: No such device
 
 which suggests that the tun device doesn't support the right
 ioctl variants.
 
 Has anyone done this? It's easy enough to do it using throw-away
 IP addresses for the two ends of the tunnel, but it's neater if
 they can be avoided.

I'd try to use the iproute2 package for that:

 # ip route show
10.1.1.0/24 dev br0  proto kernel  scope link  src 10.1.1.2
127.0.0.0/8 via 127.0.0.1 dev lo  scope link
default via 10.1.1.1 dev br0

 # ip route add 10.20.0.0/16 dev br0

# ip route show
10.1.1.0/24 dev br0  proto kernel  scope link  src 10.1.1.2
10.20.0.0/16 dev br0  scope link
127.0.0.0/8 via 127.0.0.1 dev lo  scope link
default via 10.1.1.1 dev br0

I guess that it should work the same for the other devices.
Before adding routing you should bring the interface up:
# ip link set tun0 up

regards
pshem

-- 
gentoo-user@gentoo.org mailing list