Problem with creating GRE tunnels

Hello! Got a trouble with creating GRE-tunnels via ifcfg-greX files in /etc/sysconfig/network/

  1. wicked ifstatus all before modprobe ip_gre command:
lo              up
      link:     #1, state up
      type:     loopback
      config:   compat:suse:/etc/sysconfig/network/ifcfg-lo
      leases:   ipv4 static granted
      addr:     ipv4 127.0.0.1/8 [static]

enp0s3          up
      link:     #4, state up, mtu 1500
      type:     ethernet, hwaddr 08:00:27:ad:8a:fb
      config:   compat:suse:/etc/sysconfig/network/ifcfg-enp0s3
      leases:   ipv4 dhcp granted
      addr:     ipv4 10.0.2.15/24 [dhcp]
      route:    ipv4 default via 10.0.2.2
  1. Installed modprobe ip_gre && lsmod | grep gre:
ip_gre                 18245  0 
ip_tunnel              23809  1 ip_gre
gre                    13796  1 ip_gre
  1. Now we can see the difference between stdouts of different network tools:

wicked ifstatus all:

lo              up
      link:     #1, state up
      type:     loopback
      config:   compat:suse:/etc/sysconfig/network/ifcfg-lo
      leases:   ipv4 static granted
      addr:     ipv4 127.0.0.1/8 [static]

enp0s3          up
      link:     #4, state up, mtu 1500
      type:     ethernet, hwaddr 08:00:27:ad:8a:fb
      config:   compat:suse:/etc/sysconfig/network/ifcfg-enp0s3
      leases:   ipv4 dhcp granted
      addr:     ipv4 10.0.2.15/24 [dhcp]
      route:    ipv4 default via 10.0.2.2

gre0            device-unconfigured
      link:     #9, state down, mtu 1476
      type:     gre, local-address 0.0.0.0, remote-address 0.0.0.0

gretap0         device-unconfigured
      link:     #10, state down, mtu 1476
      type:     ethernet, hwaddr 00:00:00:00:00:00


ip link show:


1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
4: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 08:00:27:ad:8a:fb brd ff:ff:ff:ff:ff:ff
9: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default 
    link/gre 0.0.0.0 brd 0.0.0.0
10: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff

and

ifconfig:


enp0s3    Link encap:Ethernet  HWaddr 08:00:27:AD:8A:FB  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12893 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8751 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8244313 (7.8 Mb)  TX bytes:1127701 (1.0 Mb)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

As we can see, ifconfig doesn’t show any info about generated GRE-devices.

Q1: So, where wicked and ip read the info about just generated GRE-devices from, and can I configure them?

Then, in the openSUSE-way, I create /etc/sysconfig/network/ifcfg-gre1 file with content (just only for example):

DEVICE=‘gre1’
ONBOOT=‘yes’
BOOTPROTO=‘static’
TUNNEL_REMOTE_IPADDR=‘1.1.1.1’
TUNNEL_LOCAL_IPADDR=‘10.0.2.15’
TUNNEL_TTL=‘255’

and then wicked ifstatus all, it returns:


lo              up
      link:     #1, state up
      type:     loopback
      config:   compat:suse:/etc/sysconfig/network/ifcfg-lo
      leases:   ipv4 static granted
      addr:     ipv4 127.0.0.1/8 [static]

enp0s3          up
      link:     #4, state up, mtu 1500
      type:     ethernet, hwaddr 08:00:27:ad:8a:fb
      config:   compat:suse:/etc/sysconfig/network/ifcfg-enp0s3
      leases:   ipv4 dhcp granted
      addr:     ipv4 10.0.2.15/24 [dhcp]
      route:    ipv4 default via 10.0.2.2

gre0            device-unconfigured
      link:     #9, state down, mtu 1476
      type:     gre, local-address 0.0.0.0, remote-address 0.0.0.0

gretap0         device-unconfigured
      link:     #10, state down, mtu 1476
      type:     ethernet, hwaddr 00:00:00:00:00:00

gre1            no-device

After wicked ifup gre1, it returns

wicked: device gre1: operation timed out
gre1            no-device

But when I proceed ip tunnel add gre1 local 10.0.2.15 remote 192.168.1.1 ttl 255, the wicked ifstatus all returns:


lo              up
      link:     #1, state up
      type:     loopback
      config:   compat:suse:/etc/sysconfig/network/ifcfg-lo
      leases:   ipv4 static granted
      addr:     ipv4 127.0.0.1/8 [static]

enp0s3          up
      link:     #4, state up, mtu 1500
      type:     ethernet, hwaddr 08:00:27:ad:8a:fb
      config:   compat:suse:/etc/sysconfig/network/ifcfg-enp0s3
      leases:   ipv4 dhcp granted
      addr:     ipv4 10.0.2.15/24 [dhcp]
      route:    ipv4 default via 10.0.2.2

gre0            device-unconfigured
      link:     #9, state down, mtu 1476
      type:     gre, local-address 0.0.0.0, remote-address 0.0.0.0

gretap0         device-unconfigured
      link:     #10, state down, mtu 1476
      type:     ethernet, hwaddr 00:00:00:00:00:00

gre1            device-unconfigured
      link:     #11, state down, mtu 1476
      type:     gre, local-address 10.0.2.15, remote-address 192.168.1.1

So, we can see, the gre1 is in device-list and after ip link set gre1 up the status was changed to up:


gre1            device-unconfigured
      link:     #11, state up, mtu 1476
      type:     gre, local-address 10.0.2.15, remote-address 192.168.1.1

So, please, help me to reach the logic of adding needed gre-devices, when using ifcfg-greX files, because ip command way looks much more easy, so it’s not clear the necessity of wicked framework. I suppose, that wicked-\ifcfg-way is also easy and pretty-good, but I can’t get the right way to reach it. Thanks a lot!

Resolved. I used incorrect ifcfg-gre1 syntax. :frowning: With example from man ifcfg-tunnel:

STARTMODE=‘onboot’
BOOTPROTO=‘static’
TUNNEL=‘gre’
TUNNEL_LOCAL_IPADDR=‘192.168.1.2’
TUNNEL_REMOTE_IPADDR=‘172.16.2.3’
IPADDR=‘10.20.30.40’
TUNNEL_TTL=‘64’

everything works fine.

One thing: to bring created GRE-interface up, you need to use correct command line: wicked ifup --ifconfig compat:/etc/sysconfig/network gre1
Simple wicked ifup gre1
command will not work.

Question Q1 (see above) is still actual.