AnswerBun.com

How to configure a GRE tunnel for ubuntu?

Unix & Linux Asked by natf2d on December 6, 2020

I am trying to configure a gre tunnel between two Ubuntu PCs: 1st with wlan1 interface 192.168.1.51 and 2nd with wlan2 192.168.1.2.

PC1:

ip link add gre1 type gretap remote 192.168.1.2 local 192.168.1.51
ip link set dev gre1 up

[email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1462 qdisc pfifo_fast state
UNKNOWN mode DEFAULT group default qlen 1000
link/ether 92:d0:28:8b:3e:a6 brd ff:ff:ff:ff:ff:ff promiscuity 0 
gretap remote 192.168.1.2 local 192.168.1.51 ttl inherit 

PC2:

ip link add gre1 type gretap remote 192.168.1.51 local 192.168.1.2
ip link set dev gre1 up

7: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1462 qdisc pfifo_fast
state UNKNOWN mode DEFAULT group default qlen 1000
link/ether ba:09:9a:66:85:02 brd ff:ff:ff:ff:ff:ff promiscuity 0 
gretap remote 192.168.1.51 local 192.168.1.2 ttl inherit 

But when I ping from .51 to .2, I don’t see any GRE encapsulation. It is just going over wlan interface.

PC1:

10.1.0.0/16 dev eth0  proto kernel  scope link  src 10.1.0.51  metric 1 
192.168.1.0/24 dev wlan1  proto kernel  scope link  src 192.168.1.51

One Answer

i know this is an old question, but looking for something else, i found this and decided to answer.

Long story short, it doesn't work that way.

bit longer of an answer: both ends need separate IPs: the tunnel endpoints would get a more different IP than the WLAN addresses. So, you have 192.168.1.0/24 as your main (physical) network. you would then have, say, 10.0.0.0/24 as your virtual (GRE) network. if you give the gre1 interfaces an ip in the 10.0.0.0/24 subnet, and ping then, they will go over GRE links then. watching traffic on the wlan connections should then show you the GRE encapsulation.

Answered by TiernanO on December 6, 2020

Add your own answers!

Related Questions

Win-Kex Screen Resolution

0  Asked on September 20, 2020

       

How to call .bashrc function in script

1  Asked on September 14, 2020 by young_souvlaki

       

recursive statistics on file types in directory?

5  Asked on September 13, 2020 by user394

   

clamd randomly stops

1  Asked on September 13, 2020 by walter

   

Authentication fails though the password is correct

0  Asked on September 3, 2020 by rohit-pillai

     

Cant’t load Windows 10 anymore

1  Asked on August 31, 2020 by j-doe

       

Change order a icons in system tray widget in KDE?

1  Asked on August 29, 2020 by paddy

 

rts5139/rtsx_usb borked in 3.15+

2  Asked on August 27, 2020 by roman

     

ETH0 no address ip with ifconfig

1  Asked on August 24, 2020 by akame14

     

Kali Linux 2020.2 Wifi Not Working (Realtek)

0  Asked on August 18, 2020 by harriet

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir