OPENVPN only for one port

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
klapuch
OpenVpn Newbie
Posts: 1
Joined: Sat Feb 25, 2017 3:00 pm

OPENVPN only for one port

Post by klapuch » Sat Feb 25, 2017 3:15 pm

Hello,
can you help me?
I have a server that connects lan to internet. eth0 and eth3 are internet connections, eth1 and eth2 are lan connections.

Code: Select all

>ip route
default
        nexthop via 10.0.0.138  dev eth0 weight 1
        nexthop via 89.25.153.1  dev eth3 weight 3
10.0.0.0/24 dev eth0  scope link  src 10.0.0.1
89.25.153.0/24 dev eth3  scope link  src 89.25.153.30
192.168.0.0/24 dev eth1  scope link  src 192.168.0.1
192.168.1.0/24 dev eth2  scope link  src 192.168.1.1
and I have a tun1 openvpn to another server:

Code: Select all

ifconfig
tun1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.11.10.2  P-t-P:10.11.10.2  Mask:255.255.255.0

Code: Select all

ip route (when tun1 active)
default
        nexthop via 10.0.0.138  dev eth0 weight 1
        nexthop via 89.25.153.1  dev eth3 weight 3
10.0.0.0/24 dev eth0  scope link  src 10.0.0.1
[b]10.11.10.0/24 dev tun1  proto kernel  scope link  src 10.11.10.2[/b]
89.25.153.0/24 dev eth3  scope link  src 89.25.153.30
192.168.0.0/24 dev eth1  scope link  src 192.168.0.1
192.168.1.0/24 dev eth2  scope link  src 192.168.1.1
I can run openvpn on any machine on lan and it connects to vpn.
What I need to do is connect to vpn from the server (it is working) and redirect one port (example http - 80) via vpn (not working).
I can see packets are going on the other vpn end but they aren't coming back and even if they are - it makes no connections.
I know I have to add any route but nothing I thought about worked. iptables INPUT/FORWARD/OUTPUT are open, forwarding = 1
Any ideas?
---
What I mean - I want to anybody from LAN side when they connect to http they connect via VPN. Any other connections are working as before.

Post Reply