Datai.Net Datai.Net

  • Home
Home / Cisco, Ubuntu Server / Ubuntu ~ GRE Tunnel to Cisco Router

Ubuntu ~ GRE Tunnel to Cisco Router

Ubuntu Server Tunnel

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
-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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
!
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}}
!
CiscoUbuntu Server

Related Articles

  • Ubuntu 20.x ~ DHCP Server Setup
  • Cisco ASA : Initial Device Setup
  • Cisco Interface Troubleshooting
  • TACACS+ ~ Linux TACACS+ Authentication using Active Directory
  Copyright © 2020 | Datai.Net | All Rights Reserved