Howdy, Stranger!

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


Mirror OpenVPN ports
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.