Re: Error trying to create gre tunnel

2017-08-11 Thread Robert Elz
Date:Fri, 11 Aug 2017 22:55:41 -0400
From:"D'Arcy Cain" 
Message-ID:  <711b9619-36ef-fedf-cfcf-39a9b969d...@netbsd.org>

  | I thought about that but my Linksys WRT router doesn't appear to have 
  | the ability to forward anything but TCP and UDP.

Since you have control over both ends, you could switch to GRE over UDP
and suffer the small MTU hit.

kre



Re: Error trying to create gre tunnel

2017-08-11 Thread Valery Ushakov
Andy Ruhl  wrote:

> On Fri, Aug 11, 2017 at 3:53 PM, D'Arcy Cain  wrote:
>> On 08/11/2017 12:37 PM, D'Arcy Cain wrote:
>> It turns out that I misunderstood the example.  Both servers need to be on
>> the public Internet.  In my case only the remote was.
>>
>> Is there some way to do this?  I can port forward but I suspect that that
>> won't work as it doesn't use TCP or UDP over the tunnel.  I looked at
>> OpenVPN but that only allows individual hosts to connect.  I am trying to
>> join two internal networks.
>>
>> I can get a second IP address for my system but I need something that works
>> for other clients who may not have that option.
> 
> I suppose you could try forwarding all GRE (ip protocol 47) inward to
> wherever the GRE tunnel lives inside the network. Have you tried that?
> 
> I haven't tried doing this, I can't tell you how it would work. It's
> normally best to do these tunnels at the internet facing router, and
> then set up routes so that your internal clients can reach the other
> side.

You can forward all trafic from the consumer gizmo internet facing
router (with single public IP address from the provider) to the
internal netbsd router.  It's usually called "DMZ host" in the web
interface.

To configure the tunnel on the internal router create
/etc/ifconfig.gre0 with:

  ! route add remote-outer-ip 192.168.1.1
  local-inner-ip remote-inner-ip netmask 0x link0 -link2 up
  tunnel 192.168.1.2 remote-outer-ip

Point default route on the netbsd router to remote-inner-ip.

Here 192.168.1.1 is the local address of the external consumer gizmo
router and 192.168.1.2 is the address of the netbsd router used to
talk to the gizmo.

If the other side is also behind NAT, use provider's public address
for remote-outer-ip

PS: Hmm, looking at gre(4), shouldn't the example be fixed to say

  ifconfig greN tunnel B C

-uwe



Re: Compiling a hello world X program

2017-08-11 Thread Ivan "Rambius" Ivanov
Hello Gary,

On Fri, Aug 11, 2017 at 4:51 PM,   wrote:
> "Ivan \"Rambius\" Ivanov"  wrote:
> => Hello,
> =>
> => I am trying to compile a Hello World program for X Window, but it
> => fails with an error on NetBSD 7.1
> =>
> => [...]
> =>
> => Full error is
> =>
> => $ make
> => cc -I/usr/x11R7/include -c xhello.c
> => xhello.c:2:22: fatal error: X11/Xlib.h: No such file or directory
> =>  #include 
> =>   ^
> => compilation terminated.
> => *** Error code 1
>
>I believe you want X11R7, not x11R7.
That was the problem. Thank you very much!

rambius



-- 
Tangra Mega Rock: http://www.radiotangra.com


Re: Error trying to create gre tunnel

2017-08-11 Thread D'Arcy Cain

On 08/11/2017 09:04 PM, Andy Ruhl wrote:

I suppose you could try forwarding all GRE (ip protocol 47) inward to
wherever the GRE tunnel lives inside the network. Have you tried that?


I thought about that but my Linksys WRT router doesn't appear to have 
the ability to forward anything but TCP and UDP.


--
D'Arcy J.M. Cain 
http://www.NetBSD.org/ IM:da...@vex.net


Re: Error trying to create gre tunnel

2017-08-11 Thread Jonathan A. Kollasch
On Fri, Aug 11, 2017 at 06:53:22PM -0400, D'Arcy Cain wrote:
> Is there some way to do this?  I can port forward but I suspect that
> that won't work as it doesn't use TCP or UDP over the tunnel.  I
> looked at OpenVPN but that only allows individual hosts to connect.
> I am trying to join two internal networks.

Actually, OpenVPN can be used that way.  The configuration to route
subnets may not be as straightforward, but it isn't an entirely unusual
configuration either.

Jonathan Kollasch


Re: Error trying to create gre tunnel

2017-08-11 Thread D'Arcy Cain

On 08/11/2017 12:37 PM, D'Arcy Cain wrote:
I made this work on one NetBSD system but two machines on the local side 
fail.  One is a 7.1 server and the other is current.


ifconfig gre0 create
ifconfig gre0 10.255.255.1 10.255.255.2 netmask 255.255.255.252
ifconfig gre0 tunnel 207.35.13.14 98.158.139.79

The last line gives this error.

ifconfig: SIOCSLIFPHYADDR: Can't assign requested address

Both of those addresses are live, public addresses.  I can ping either 
one from the machine I am trying to use as the tunnel endpoint.  Why 
would this work on the remote side but not the local side?


Even after the error I am able to add a route to the remote network but, 
of course, it doesn't work.


It turns out that I misunderstood the example.  Both servers need to be 
on the public Internet.  In my case only the remote was.


Is there some way to do this?  I can port forward but I suspect that 
that won't work as it doesn't use TCP or UDP over the tunnel.  I looked 
at OpenVPN but that only allows individual hosts to connect.  I am 
trying to join two internal networks.


I can get a second IP address for my system but I need something that 
works for other clients who may not have that option.


--
D'Arcy J.M. Cain 
http://www.NetBSD.org/ IM:da...@vex.net


Error trying to create gre tunnel

2017-08-11 Thread D'Arcy Cain
I made this work on one NetBSD system but two machines on the local side 
fail.  One is a 7.1 server and the other is current.


ifconfig gre0 create
ifconfig gre0 10.255.255.1 10.255.255.2 netmask 255.255.255.252
ifconfig gre0 tunnel 207.35.13.14 98.158.139.79

The last line gives this error.

ifconfig: SIOCSLIFPHYADDR: Can't assign requested address

Both of those addresses are live, public addresses.  I can ping either 
one from the machine I am trying to use as the tunnel endpoint.  Why 
would this work on the remote side but not the local side?


Even after the error I am able to add a route to the remote network but, 
of course, it doesn't work.


--
D'Arcy J.M. Cain 
http://www.NetBSD.org/ IM:da...@vex.net


Re: Compiling a hello world X program

2017-08-11 Thread gary
"Ivan \"Rambius\" Ivanov"  wrote:
=> Hello,
=>
=> I am trying to compile a Hello World program for X Window, but it
=> fails with an error on NetBSD 7.1
=>
=> [...]
=>
=> Full error is
=>
=> $ make
=> cc -I/usr/x11R7/include -c xhello.c
=> xhello.c:2:22: fatal error: X11/Xlib.h: No such file or directory
=>  #include 
=>   ^
=> compilation terminated.
=> *** Error code 1

   I believe you want X11R7, not x11R7.

  Gary Duzan





Compiling a hello world X program

2017-08-11 Thread Ivan "Rambius" Ivanov
Hello,

I am trying to compile a Hello World program for X Window, but it
fails with an error on NetBSD 7.1

xhello.c:2:22: fatal error: X11/Xlib.h: No such file or directory

My program is

#include 
#include 

int main(int argc, char **argv) {
return 0;
}

My makefile is

$ cat Makefile
.PHONY: clean
xhello: xhello.o
cc -static -o xhello xhello.o -L /usr/X11R7/lib -lX11

xhello.o: xhello.c
cc -I/usr/x11R7/include -c xhello.c

clean:
rm -f *.o xhello

Full error is

$ make
cc -I/usr/x11R7/include -c xhello.c
xhello.c:2:22: fatal error: X11/Xlib.h: No such file or directory
 #include 
  ^
compilation terminated.
*** Error code 1

Stop.
make: stopped in /home/rambius/drafts/X

I verified that /usr/x11R7/include exists and that it has X11/Xlib.h
header file.

What am I doing wrong? I will be very grateful for any hints.

Regards
rambius

-- 
Tangra Mega Rock: http://www.radiotangra.com