在 GCP VPS 实例、CentOS7 中使用专用 IP 设置 GRE 隧道
Setup a GRE tunnel with dedicated IP in GCP VPS instance, CentOS7
我在 GCP 中成功创建了一个新的 VPS 实例。通过 ssh 登录并获取 root 访问权限。我设置 tun1 接口的命令已成功完成:
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
如果我用 lsmode 检查 | grep gre,我明白了
# lsmod | grep tun
tun 31740 0
ip_tunnel 25163 1 ip_gre
我也试试:
# 调制探测器 ip_tunnel
# modprobe gre
#
没有显示结果。
如果一切正常,我应该可以使用外部专用 IP xxx.xxx.xxx.xx(它是一个 Cloud DNS 系统)访问我的服务器。
求助,有人能帮帮我吗?
遗憾的是 Google 不允许 GRE 流量。
看这里:
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.
我在 GCP 中成功创建了一个新的 VPS 实例。通过 ssh 登录并获取 root 访问权限。我设置 tun1 接口的命令已成功完成:
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
如果我用 lsmode 检查 | grep gre,我明白了
# lsmod | grep tun
tun 31740 0
ip_tunnel 25163 1 ip_gre
我也试试: # 调制探测器 ip_tunnel # modprobe gre #
没有显示结果。
如果一切正常,我应该可以使用外部专用 IP xxx.xxx.xxx.xx(它是一个 Cloud DNS 系统)访问我的服务器。
求助,有人能帮帮我吗?
遗憾的是 Google 不允许 GRE 流量。
看这里: 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.