Ubuntu Server Tunnel
auto tun1
iface tun1 inet static
address {{local-private-ip4-address}}
netmask 255.255.255.252
pre-up iptunnel add tun1 mode gre local {{local-public-ip4-address}} remote {{remote-public-ip4-address}} ttl 255
up ifconfig tun1 multicast
pointopoint {{remote-private-ip4-address}}
post-down iptunnel del tun1
auto tun1
iface tun1 inet static
address {{local-private-ip4-address}}
netmask 255.255.255.252
pre-up iptunnel add tun1 mode gre local {{local-public-ip4-address}} remote {{remote-public-ip4-address}} ttl 255
up ifconfig tun1 multicast
pointopoint {{remote-private-ip4-address}}
post-down iptunnel del tun1
auto tun1 iface tun1 inet static address {{local-private-ip4-address}} netmask 255.255.255.252 pre-up iptunnel add tun1 mode gre local {{local-public-ip4-address}} remote {{remote-public-ip4-address}} ttl 255 up ifconfig tun1 multicast pointopoint {{remote-private-ip4-address}} post-down iptunnel del tun1
If you are running a firewall on your Ubuntu server, you will need to make sure to allow GRE tunnelling through the firewall.
-A PUBLIC -p gre -m comment --comment "GRE Tunneling" -j ACCEPT
-A PUBLIC -p gre -m comment --comment "GRE Tunneling" -j ACCEPT
-A PUBLIC -p gre -m comment --comment "GRE Tunneling" -j ACCEPT
Cisco IOS Tunnel
!
interface Tunnel1
ip address {{local-private-ip4-address}} 255.255.255.252
ip mtu 1400
ip tcp adjust-mss 1360
tunnel source {{local-public-ip4-address || interface-name}}
tunnel destination {{remote-public-ip4-address}}
!
!
interface Tunnel1
ip address {{local-private-ip4-address}} 255.255.255.252
ip mtu 1400
ip tcp adjust-mss 1360
tunnel source {{local-public-ip4-address || interface-name}}
tunnel destination {{remote-public-ip4-address}}
!
! interface Tunnel1 ip address {{local-private-ip4-address}} 255.255.255.252 ip mtu 1400 ip tcp adjust-mss 1360 tunnel source {{local-public-ip4-address || interface-name}} tunnel destination {{remote-public-ip4-address}} !