Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


OpenVPN: how to connect to a client
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

OpenVPN: how to connect to a client

Issam2204Issam2204 Member

Hello guys!

The question may (is) stupid but I don't understand one thing.

I use a Kimsufi server and I configured it to use OpenVPN as a client (another server is the OpenVPN server). As you know now the Kimsufi changed its IP and has the same IP of the OpenVPN server.

The question is: if I want to connect to the webui of a program running on the kimsufi, how do I do that since the IP changed?

Comments

  • MuZoMuZo Member

    You have to do port forwarding on the VPN server IP

    Thanked by 2Issam2204 KwiceroLTD
  • Thank you for the intuition MuZo!

    I'll try to find something online. If you happen to know any good guide that I can read that would be great :)

  • MuZoMuZo Member

    Just search on Google how to do port forwarding with iptables. Set the port to go to the VPN client IP so it will be sent over the VPN to the client.

    Thanked by 1Issam2204
  • iptables -t nat -A PREROUTING -p tcp --dport port -j DNAT --to-destination ip:port


    port=external port
    ip:port=openvpnclientip:internalport

    Thanked by 1Issam2204
  • 4n0nx4n0nx Member

    the internal IP address of the kimsufi in the VPN might change after a reconnect, not sure...

    Thanked by 1Issam2204
  • @4n0nx said:
    the internal IP address of the kimsufi in the VPN might change after a reconnect, not sure...

    You can configure Openvpn to provide the same internal IP to specific users.

    Thanked by 14n0nx
  • getvpsgetvps Member

    My suggestion is excluded , you can use dynamic dns for any type of ip or other method of notification for new ip.. if everything else not working.

  • 4n0nx4n0nx Member

    ACaton said: You can configure Openvpn to provide the same internal IP to specific users.

    go on...

  • Issam2204Issam2204 Member
    edited May 2015

    @ACaton said:
    iptables -t nat -A PREROUTING -p tcp --dport port -j DNAT --to-destination ip:port


    port=external port
    ip:port=openvpnclientip:internalport

    Thanks for your answer ACaton!

    I don't understand one thing: the "ip:port", ip referes to "true ip of the client" or the ip after connecting to the server? Also, what do you mean with external port and internal port?

    I'm reading around about forwarding and NAT using iptables but I'm still a bit lost :)

    EDIT: It works :) Thank you very much!!

  • Issam2204 said: I'm reading around about forwarding and NAT using iptables but I'm still a bit lost :)

    Glad it worked out for you. It took me a bit to find the proper information as well, so I know how you feel. At the end it is a pretty simple command and works like a charm.

    Thanked by 1Issam2204
  • Very true! Again, thanks :)

Sign In or Register to comment.