0

I have tunneled my local server to cloud server with VPN tunnel (Tinc). Both servers can talk each other on tun0 interfaces.

My cloud server can be accessible through Internet with public IP address assigned to its eth0 interface. I want my local server to be directly accessible on my cloud server's public IP address. I have tried to bridge cloud's eth0 and tun0 interfaces with commands below :

ip link add name br0 type bridge
ip link set dev br0 up
ip link set dev tun0 master br0
ip link set dev eth0 master br0

But eth0 isnt functioning once I bridge eth0 interface (last command above). I suspect that, it is some kind of protection that VPS provider (Digital Ocean) has made. What might i be doing wrong? What other options I have?

Kerem atam
  • 101
  • 4

1 Answers1

0

Let me answer to my own question. Reverse Proxy Server of NGINX can solve this by creating such config file : /etc/nginx/sites-enabled/tunnel-config

server {
    listen <cloud server port> default_server;
    server_name  localhost;
    large_client_header_buffers 4 32k;
    root /usr/share/nginx/html;
    index index.html index.htm;
    location / {
        proxy_pass <tunneled remote server IP>:<port>;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Here are some sources for detailed explanations :

https://www.nginx.com/resources/admin-guide/reverse-proxy/

https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-reverse-proxy-for-apache

Kerem atam
  • 101
  • 4
  • Link-only answers are discouraged to prevent link-rot - could you include the relevant content in your answer, please? – BE77Y Jan 04 '17 at 16:23