简体   繁体   中英

Setup a GRE tunnel with dedicated IP in GCP VPS instance, CentOS7

I had create a new VPS instance in GCP successfully. Logged in via ssh and take root access. My commands to setting up a tun1 interface was successfull done:

ip tunnel del tun1
ip tunnel add tun1 mode gre remote xxx.xxx.xxx.xx local xx.xxx.xxx.xxx ttl 255
ip link set tun1 up
ip link set tun1 mtu 1360
ip addr add xxx.xxx.xxx.xx/32 dev lo
ip r add xxx.xxx.xxx.x/32 dev tun1
ip route add default via xxx.xxx.xxx.x dev tun1 table 200
ip rule add from xxx.xxx.xxx.xx table 200

If I check with lsmode | grep gre, I see

# lsmod | grep tun
tun         31740  0 
ip_tunnel   25163  1 ip_gre

I try also: # modprobe ip_tunnel # modprobe gre #

No results be displayed.

If everything is okay, I should be able to access my server with the external dedicated IP xxx.xxx.xxx.xx (it is a Cloud DNS system).

Push, could anybody out there help me?

Unfortunately Google doesn't allow GRE traffic.

See here: https://cloud.google.com/vpc/docs/firewalls#blockedtraffic

Always blocked traffic Google Cloud always blocks the traffic that is described in the following table. Your firewall rules cannot be used to allow any of this traffic.

Always blocked traffic Applies to GRE traffic All sources and destinations, whether the source or destination is an internal IP address or an external IP address.

This is now supported.

External IPv4 and IPv6 addresses only accept TCP, UDP, ICMP, IPIP, AH, ESP, SCTP, and GRE packets. Resources that use external IP addresses impose additional protocol restrictions:

Forwarding rules for protocol forwarding, external HTTP(S) Load Balancing, External SSL Proxy Load Balancing, External TCP Proxy Load Balancing, and Network Load Balancing only process the protocols and ports configured on the forwarding rule.
Cloud VPN gateways only accept VPN protocols.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM