Subject: gif interfaces
To: None <netbsd-help@netbsd.org>
From: Dima Veselov <kab00m@lich.phys.spbu.ru>
List: netbsd-help
Date: 08/24/2003 21:29:03
Hello!

I have a problem using gif interfaces on NetBSD systems.

The situation is: I have two routers, connected to internet at one point
(hub), and I need to have IPSEC connection between LAN's behind them.
Even routers IPs belong to one subnet. One of routers have "grey" lans behind,
and NAT's them, so I want to build gif pseudo-interface on it. In the case of
successful gif installation I can get NAT working only for ex0 (internet interface)
and not working for gif0.

Example:

LAN1|-------              -------|LAN4 (host E)
LAN2|router1|----Hub-----|router2|LAN5
LAN3|-------      |       -------
              Internet

router1 has external address A, router2 IP is B. Both are NetBSD 1.6.1 and both in the
same network.

First question: gif0 address should be A, as ex0?
Second: As I assume gif0 should be built on both sides of tunnel, isn't it? So, 
packet got out from gif0 receives in gif0 on the other end of tunnel?

Following manpage I execute on router1:
ifconfig gif0 create
ifconfig gif0 A netmask 0xffffffff tunnel A D up
route add E 0
route change E -ifp gif0

On router2:
ifconfig gif0 create
ifconfig gif0 D netmask 0xffffffff tunnel D A up

On router1 I get:

[root@A kab00m]$ ping E
PING E: 56 data bytes
ping: sendto: Can't assign requested address
ping: sendto: Can't assign requested address

Netstat -i says I have two Ipkts and two Opkts on this host. It doesn't grow.

What errors I made in this?

Thanks a lot in advance.

By the way is gif manpage is right, describing gif installation for host D on NetBSD?

-- 
Sincerelly yours