0

I want to add gre tunnel in netplan.

name: gre0, mode: gre, remote: 10.11.22.100, local: 10.11.22.99, dev: eth1 I don't know what key value to put interface eth1 into gre0.

network:
    version: 2
    renderer: networkd
    ethernets:
        eth0:
            dhcp4: false
            dhcp6: false
            addresses: []
            nameservers:
                addresses:
                - 8.8.8.8
                - 8.8.8.9
        eth1:
            dhcp4: false
            dhcp6: false
            addresses: []
        eth2:
            dhcp4: false
            dhcp6: false
            mtu: 1500
            addresses:
            - 10.11.29.11/16
            - fe80::20c:29ff:fe83:fd2d/64
            routes:
            -
                to: 0.0.0.0/0
                via: 10.11.0.1
                metric: 1
    tunnels:
        gre0:
            mode: gre
            local: 10.11.22.99
            remote: 10.11.22.100
            addresses:
            - 10.11.22.90/24
            mtu: 1500

The result of netplan apply was also different from what I expected. I don't know why gretap0 and erspan0 are created.

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:83:fd:37 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fe83:fd37/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:83:fd:41 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fe83:fd41/64 scope link
       valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:83:fd:2d brd ff:ff:ff:ff:ff:ff
    inet 10.11.29.11/16 brd 10.11.255.255 scope global eth2
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe83:fd2d/64 scope link
       valid_lft forever preferred_lft forever
5: gre0@NONE: <NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/gre 0.0.0.0 brd 0.0.0.0
    inet 10.11.22.90/24 brd 10.11.22.255 scope global gre0
       valid_lft forever preferred_lft forever
6: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
7: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN group default qlen 1000

2 Answers 2

0

You do not put an ethernet device "into" a tunnel. A tunnel runs on top of your existing network layer. The local address of a tunnel specifies which of your local IP addresses to use for the tunnel endpoint, and the remote address of a tunnel specifies the already-reachable (via Internet or intranet) address of the other end of the tunnel.

In your config above, you have specified as local an IP address (10.11.22.99) that does not appear to actually be local (i.e., this is not a configured address on any of your interfaces). It is not clear that the remote you have specified is correct either, since it falls within the network you're defining (via addresses) as being routed across the tunnel.

addresses are the addresses assigned to the tunnel. remote and local are the addresses of the two tunnel endpoints which are outside the tunnel and used to set it up.

0

It seems that the gre0 name is restricted to GRE fallback (say when IP.src and IP.dst for the specific tunnel do not match, 10.11.22.100 -> 10.11.22.99 in your case). Reason why you have the defaults gre0@NONE etc. created by ip_gre kernel module.

You should change the name to mygre for example ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .