GRE tunnel can't connect

Discussions about using Linux guests in VirtualBox.
Post Reply
gulamerah
Posts: 17
Joined: 7. Apr 2013, 15:57
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: various ubuntu varian

GRE tunnel can't connect

Post by gulamerah »

hi everyone,

i've been trying to create gre tunnel for days, but it won't connect.
i'm using virtual box 4.2.10 , ubuntu server 12.04 on windows 7 host.
the network interfaces for each VBOX are same. eth0 uses NAT interfaces and eth1 uses bridged networking with "allow all" option enabled

in /etc/network/interfaces VBOX A eth1 - ip address 10.10.10.1
in /etc/network/interfaces VBOX B eth1 - ip address 20.20.20.1

so, i'm trying to create a tunnel between that network using this setting :
VBOX A
---------
sudo modprobe ip_gre
sudo iptunnel add gre1 mode gre remote 20.20.20.1 local 10.10.10.1 ttl 225
ifconfig gre1 1.1.1.1/24
ifconfig gre1 up
ifconfig gre1 pointopoint 1.1.1.2
ifconfig gre1 multicast

VBOX B
---------
sudo modprobe ip_gre
sudo iptunnel add gre1 mode gre remote 10.10.10.1 local 20.20.20.1 ttl 225
ifconfig gre1 1.1.1.2/24
ifconfig gre1 up
ifconfig gre1 pointopoint 1.1.1.1
ifconfig gre1 multicast

in each VBOX , ifconfig shows the tunnels are up. i can ping the tunnel interface in it's box. but i can't reach the other side of the tunnel.
i think it's a simple configuration. but i'm stuck in it. i've tinkering for days but cannnot figure out what's wrong with the configuration....

i'll be so grateful if anyone can help
Attachments
ifconfig command
ifconfig command
tunnel.PNG (10.68 KiB) Viewed 5913 times
ip tun command
ip tun command
ip tun.PNG (3.28 KiB) Viewed 5913 times
ip link
ip link
ip link.PNG (19.75 KiB) Viewed 5913 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: GRE tunnel can't connect

Post by Perryg »

gulamerah
Posts: 17
Joined: 7. Apr 2013, 15:57
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: various ubuntu varian

Re: GRE tunnel can't connect

Post by gulamerah »

thanks for your fast reply.

from the doc, it said that there's a possibilty to setup a tunnel if i'm not mistaken.
do you know what to setup to enable the tunneling? should i change the adapter to "host-only"??

actually my goal is to virtualize a DMVPN network using virtual box, so i'll have to setup ipsec later.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: GRE tunnel can't connect

Post by Perryg »

You only need to *not use VBox NAT. It does not support the protocols needed.
gulamerah
Posts: 17
Joined: 7. Apr 2013, 15:57
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: various ubuntu varian

Re: GRE tunnel can't connect

Post by gulamerah »

i use 2 interface in my VBOX .
first eth0 (NAT) so i can connect to internet.
second eth1 (bridged networking) which i connect the tunnel.
i've set a static ip in the linux guest /etc/network/interfaces .

my question is, how is the right configuration for gre tunnel ? i've tried the configuration mentioned above, and other configuration but none of the succedd.
the tunnel can be created, but cannot reach other tunnel
it's so confusing. some of other configuration i saw on the net look no different and i've tried the without good result :(
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: GRE tunnel can't connect

Post by noteirak »

This is a networking problem, which is quite outside of the scope of this forum.
i will still give you this : you are using 10.xxxx and 20.xxxx, what about the subnets? What about the routing? Vbox NAT is also in 10.xxxx, so is it not conflicting?
GRE tunneling is advanced networking topic, so the best place would a networking forum.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
gulamerah
Posts: 17
Joined: 7. Apr 2013, 15:57
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: various ubuntu varian

Re: GRE tunnel can't connect

Post by gulamerah »

noteirak wrote:This is a networking problem, which is quite outside of the scope of this forum.
i will still give you this : you are using 10.xxxx and 20.xxxx, what about the subnets? What about the routing? Vbox NAT is also in 10.xxxx, so is it not conflicting?
GRE tunneling is advanced networking topic, so the best place would a networking forum.
thanks for your advice . you are right, it's pretty confusing, beside i'm new to linux and vbox..

about the ip address range, i have tried different address too but the tunnel is still not workng.
the address fof VBOX A : 172.168.1.1/24 and VBOX B 172.168.2.1/24
i've read and googling these days and found the settings are simple but i don't know what's wrong with my own setting .
i just follow the tutorial, but still no result .

noteirak wrote: i will still give you this : you are using 10.xxxx and 20.xxxx, what about the subnets? What about the routing? Vbox NAT is also in 10.xxxx, so is it not conflicting?
i think if i can achieve GRE the routing would be easier
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: GRE tunnel can't connect

Post by Martin »

Did you try a private IP address range for the tunnel? 1.1.1.x is reserved somewhere in the Internet ;)
gulamerah
Posts: 17
Joined: 7. Apr 2013, 15:57
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: various ubuntu varian

Re: GRE tunnel can't connect

Post by gulamerah »

Martin wrote:Did you try a private IP address range for the tunnel? 1.1.1.x is reserved somewhere in the Internet ;)
yes, but it is a private nework. so it will not connect to internet. and i have tried other ip address, reinstalling VBOX and the result is just same.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: GRE tunnel can't connect

Post by noteirak »

gulamerah wrote:the address fof VBOX A : 172.168.1.1/24 and VBOX B 172.168.2.1/24
These are two different subnets, you must have a router in between them, or it will not work, first of all.

You seem to lack quite a lot of network understanding, which is not an issue itself, but is definitly one for what you are trying to achieve.
Either stick to the letter of your tutorial, or get some network understanding first.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
gulamerah
Posts: 17
Joined: 7. Apr 2013, 15:57
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: various ubuntu varian

Re: GRE tunnel can't connect

Post by gulamerah »

noteirak wrote:
gulamerah wrote:the address fof VBOX A : 172.168.1.1/24 and VBOX B 172.168.2.1/24
These are two different subnets, you must have a router in between them, or it will not work, first of all.

You seem to lack quite a lot of network understanding, which is not an issue itself, but is definitly one for what you are trying to achieve.
Either stick to the letter of your tutorial, or get some network understanding first.
noteirak thanks so much for giving me a hint, the tunnel is a success now. :D
after i try it again , the problem is "gateway". i haven't set gateway for the outgoing interface, that's eth1.
so, this is my working settings :
VBOX A ip address : 172.168.1.1/24 and for tunnel 10.0.201.1/24
VBOX B ip address : 172.168.2.1/24 and for tunnel 10.0.201.2/24

and i'll continue to try ipsec to achieve my goal : dmvpn
thanks everyone.
Attachments
ping from VBOX A
ping from VBOX A
ping 1.PNG (11.89 KiB) Viewed 5877 times
seting in /etc/network/interfaces so the tunnel would start again after reboot
seting in /etc/network/interfaces so the tunnel would start again after reboot
interfaces1.PNG (13.87 KiB) Viewed 5877 times
Post Reply