VPN redirect user to specific IP and port

Jorge

Hope you can point me in the right direction. I have this idea but need some advice and suggestions where to look at and how to do it (if it's possible)

I want my family members to connect to a VPN (linux server) using username and password, then I want to redirect each user to a specific port inside the same IP, let me describe it better:

user1 -> connects to VPN using user1 as username

Inside the VPN server I will redirect user1 to the IP and port 192.168.0.10:9800

Note: I am trying to use IPsec or OpenVPN, not sure which one, if you have a better suggestion, I am open to check it out. I may be retrieveing back containers with command lines linux only, RDP windows or VNC. I don't want to use a router.

Thanks!!!!

davidgo

This is definitely possible.

To do this with openVPN - set the OpenVPN config to give an IP to each user based the username. This is fairly straight forward using the ifconfig-push directive (see https://community.openvpn.net/openvpn/wiki/Concepts-Addressing?

As you now know the clients IP you can then use iptables dnat rules to redirect all traffic from the client to the appropriate port with rules like (untested - probably needs tweeking)

  iptables -t nat -A PREROUTING -s 10.0.0.1  -j REDIRECT --to-port 9800
  

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to redirect a domain to a different IP if accessed by a specific port?

Google load balancer redirect IP address to specific port?

Expose port of a specific container to external IP

Redirect requests to my external IP/port to a different external IP/port?

jquery redirect user to specific page

configure iptables to redirect traffic to a specific IP address

Using IPtables to redirect IP address range to port range

Iptables to redirect DNS lookup IP and Port

Mod_rewrite Redirect Specific IP to page

How to setup subdomain that points to a specific port on an IP

Checking user ip address after redirect

Allow specific linux user to bind to port 443

Iptables route specific port outside VPN (Tomato router firmware)

Answer redirect IP to specific port

OpenVPN -> SSL Bypass VPN on specific PORT

Configuring VPN to a specific ip address

Allow only a specific ip address to an open port

Allow only traffic to specific IP ranges to go through VPN

Redirect Local DNS redirect a specific IP address

Route specific ip adress through VPN gateway

Nginx server IP on droplet redirect to specific domain

networkmanager-strongswan vpn - routing specific ip through VPN

Redirect http to https exclude specific IP

How to Redirect Incoming Traffic on Port to a Diff IP and Port on macOS?

Redirect port and ip on macOS

Forward incoming request from specific ip to a local ip and port in ubuntu

Redirecting page to specific IP and port in lighttpd

Can we redirect a vpn traffic from a wanted port to a needed port?

Conditionally redirect a user to a specific screen