0

I have been struggling with sorting this issue for a while and cant seem to get it to work.

What I want to achieve:

enter image description here

Here I want all my clients connected to the switch to access the internet through the vpn.

This is the iptables setup i have right now, but I could very well be way off course

#Always accept loopback
iptables -A INPUT i -lo -j ACCEPT

iptables -A INPUT -i eth1 -j ACCEPT

iptables -A INPUT -i nordlynx -j ACCEPT

#############ROUTING#####################


# Allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Masquerade.
iptables -t nat -A POSTROUTING -o nordlynx -j MASQUERADE

# fowarding
iptables -A FORWARD -i nordlynx -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o nordlynx -j ACCEPT
3
  • 1
    Not sure what you are trying to do, is the client device suppose to access the internet through the VPN or do you want to access your home network from the internet via VPN? If it is the former you need to install the VPN software on the client device there is no need to go through the Rasberry Pi.
    – Albin
    Commented Mar 2, 2021 at 20:05
  • I am accessing the client devices to access the internet through the VPN. The VPN is installed on the raspberry pi, so now i want to direct the traffic from client devices through the vpn (on pi) and to the internet
    – Vinny
    Commented Mar 4, 2021 at 5:56
  • Don't write it in the comments, please work on your question. A diagram will help as well. I'm still not sure if I understand correctly.
    – Albin
    Commented Mar 4, 2021 at 8:57

0

You must log in to answer this question.

Browse other questions tagged .