LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-07-2015, 06:48 PM   #1
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
GRE tunnel - what's interface gre0 for?


I use Centos 6.7 and 7.1. Whenever I create a GRE tunnel, a network interface named gre0 pops out of nowhere as a side effect. What is the the purpose of this interface?

Example:
Code:
$ ip tunnel
$ 
$ sudo ip tunnel add gre0 mode gre remote 192.168.1.16 local 192.168.1.17 key 100
ioctl: File exists
$ ip tunnel
gre0: gre/ip  remote any  local any  ttl inherit  nopmtudisc
Later I found that gre0 is created when doing modprobe ip_gre, but this doesn't answer my question.

While gre0 is mentioned in the various cookbooks I find on the internet, I haven't found it explained anywhere.

Note that not in all cases is gre0 created automatically, e.g. this Debian cookbook.
 
Old 12-07-2015, 09:14 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,045

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Not knowing the answer might I venture a guess? greX is a faux name to use in the networking stack much like any enX or ethX would.

Most of that GRE stuff is on the Cisco pages. Then I'd guess the BSD would cover the introduction to the *nix type stuff.
 
Old 12-07-2015, 09:49 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Original Poster
Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by jefro View Post
greX is a faux name to use in the networking stack
sure, it's a "virtual" interface (not a very good name, that...) in the sense that it doesn't represent a hardware interface, but it's not really "faux". It does implement a tunnel.

Only, why does the kernel create gre0? Am I supposed to use it for something? is it required (when I try to delete it, the system complains and doesn't follow my orders)?
 
Old 12-08-2015, 09:09 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,045

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Maybe I didn't explain what I was thinking.

When a normal network stack may look for routes or any interfacing with named nic boards it has or tends to use a name. To keep convention, my guess is the people who ported gre decided to use that name to let any and all tools have a way to access it.
So, ifconfig eth0 would have some reply. My guess is that the same command or any command like that would work on gre0.


Are you trying to delete it while in use? I'd guess it would complain. Once you create it.

From an example.

$ sudo ip tunnel add gre0 mode gre remote 172.168.10.25 local 192.168.233.204 ttl 255
$ sudo ip link set gre0 up
$ sudo ip addr add 10.10.10.1/24 dev gre0

http://ask.xmodulo.com/create-gre-tunnel-linux.html


All from this stuff. http://man7.org/linux/man-pages/man8/ip-tunnel.8.html


That is unless you used something like this maybe. /etc/sysconfig/network-scripts/ifcfg-tun0
 
  


Reply

Tags
gre tunnel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep Alive GRE Tunnel gmarzilli Linux - Networking 0 01-19-2010 07:47 AM
GRE tunnel nima0102 Linux - Networking 1 07-28-2009 01:12 PM
Gre Tunnel Questions mhunter Linux - Networking 2 07-18-2007 12:17 PM
dhcp over GRE tunnel fadey Linux - Networking 0 04-29-2007 08:12 AM
Question about a GRE Tunnel zerounu Linux - Networking 1 03-09-2004 09:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration