Date: Thu, 23 Sep 2004 09:18:30 +1000 From: Edwin Groothuis <edwin@mavetju.org> To: "Mikhail P." <miha@ghuug.org> Cc: net@freebsd.org Subject: Re: question on tunnels (VPN) Message-ID: <20040922231830.GA1234@k7.mavetju> In-Reply-To: <200409221617.59860.miha@ghuug.org> References: <200409221617.59860.miha@ghuug.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 22, 2004 at 04:17:59PM +0000, Mikhail P. wrote: > HOST_A [192.168.0.1]: > ifconfig gif0 create > ifconfig gif0 tunnel 192.168.0.1 192.168.0.2 > ifconfig gif0 10.0.0.1 10.0.0.2 netmask 255.255.255.255 > > and on - > > HOST_B [192.168.0.2]: > ifconfig gif0 create > ifconfig gif0 tunnel 192.168.0.2 192.168.0.1 > ifconfig gif0 10.0.0.2 10.0.0.1 netmask 255.255.255.255 > > The above works well for me, and I can send traffic on 10.0.0.1 and 10.0.0.2. > > The next thing I wanted to implement is to create similar tunnel from our > local router (which is FreeBSD too) to remote server, however there is small > problem which stops me - router has no public IP, and it sees internet > through DSL router, so basically that router is NAT'ed behind DSL router. > As far as I understand, it appears to be that I won't be able to create such a > simple tunnel, unless my router gets public IP address. I have the same situation here and the solution was to let the ADSL router forward all unknown traffic to my router. How to do that is router specific, but it can be done. Then, with the tunnels: central# ifconfig gif1 inet gif1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280 tunnel inet 218.185.88.66 --> 203.111.122.8 inet 10.10.12.1 --> 10.10.12.2 netmask 0xffffffff remote# ifconfig gif1 inet gif1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280 tunnel inet 192.168.1.1 --> 218.185.88.66 inet 10.10.12.2 --> 10.10.12.1 netmask 0xffffff00 203.111.122.8 is my ADSL routers address. 192.168.1.1 is my computers RFC1918 address. Two static routes, one on each machine, and it works. Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040922231830.GA1234>