Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I love serverfault, I have learned quite a bit from this website. Hopefully I can learn one more thing.

  • OpenVPN Server has 30 Static WAN IP's each one has 1 user on it. Plus there is a main IP address they use to connect to the server

  • User on the static IP eth0:5 wants his static WAN IP to accept incoming connections.

  • Current configuration allows incoming connections on eth0 only. Not eth0:5

I need to get his IP accepting incoming connections instead of the OpenVPN servers main IP

Server.config

port 443 #- port
proto tcp #- protocol
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
plugin /etc/openvpn/radiusplugin.so /etc/openvpn/radiusplugintcp.cnf
client-cert-not-required
username-as-common-name
server 10.9.0.0 255.255.255.0
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 5 30
comp-lzo
persist-key
persist-tun
verb 4
reneg-sec 0
client-config-dir /etc/openvpn/ccd

Current IP Tables

-A POSTROUTING -s 10.9.0.13/32 -o eth0 -m comment --comment "dave@smrhosting.com" -j SNAT --to-source 29.127.126.6
-A POSTROUTING -s 10.9.0.0/24 -o eth0 -j MASQUERADE

Here are the commands I am using currently. These work but the incoming traffic has to point to the OpenVPN Server's static WAN IP instead of the users static WAN IP

iptables -t nat -A PREROUTING -p tcp --dport 9898 -j DNAT --to-destination 10.9.0.13
iptables -A FORWARD -s 10.9.0.13 -p tcp --dport 9898 -j ACCEPT

Any help would be awesome!

share|improve this question
    
Could you please try to rephrase the question a bit? I tried to re-read it several times but failed to comprehend what is actually required. Usually creating a bulleted list of simple sentences each stating one fact helps. –  kostix Mar 19 '13 at 10:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.