Howdy, Stranger!

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


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
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.

Mirror OpenVPN ports

J1021J1021 Member

Hello,

Up until recently I've been operating several OpenVPN servers on systems with one IP configured. I run OpenVPN on UDP port 1194 but need to mirror the service to UDP port 53, the following rule does this fine.

iptables -t nat -A PREROUTING -p udp -d 8.8.8.8 --dport 53 -j REDIRECT --to-port 1194

However recently I've tried to get the same setup working on a system with multiple IPs configured. I have 3 IPs, each configured on eth0 eth0:1 and eth0:2 respectively.

Having minimal knowledge of iptables myself and having already tried several rules, I am hoping somebody here can shed some light on how to get this working.

Jack

Comments

  • iptables -t nat -A PREROUTING -p udp -d 123.123.123.123 --dport 53 -j DNAT --to-destination 123.123.123.124:1149
    

    should work for you

    Thanked by 1J1021
  • BlazeMuisBlazeMuis Member
    edited May 2015
    iptables -t nat -A PREROUTING -p udp -d 8.8.8.8 --dport 53 -j REDIRECT --to-port 1194

    Should work...

    Thanked by 1J1021
  • J1021J1021 Member

    @AutoSnipe didn't work, not sure why.

    @joodle my issue is that OpenVPN is listening on an additional IP and that rule forwards to the default IP.

    I've got it working on both ports by binding OpenVPN to the default system IP and setting two rules to forward traffic from the additional IP to the default IP for those ports.

    Thank you both for your input.

Sign In or Register to comment.