0

I have the following network setup and having issues trying to connect. I would appreciate if you could give me some ideas about it.

My devices are

-VPN server on amazon EC2 (windows server 2016)
Has IP 10.0.1.1

-Raspberry on a remote location (running raspbian) Has:

  • 2 physical connections.

    • wlan0 is where it gets internet access.
    • eth0 is connected to a PLC which has 192.168.0.99. can ping OK
  • 1 virtual connection (vpn_se).
    VPN client attached to 10.0.1.1 (vpn server at amazon). Can ping OK

Current IP addresses on raspberry
wlan0 10.0.0.41
eth0 192.168.0.1
vpn_se 10.0.1.2

From my amazon server, i require to reach 192.168.0.99.

i already configured a static route on amazon server

route add 192.168.0.0 mask 255.255.255.0 10.0.1.1

But im unsure on what to setup on the iptables.

Can you please give me some ideas?

Here is a rough diagram of my current setup View post on imgur.com

0

You will need to make sure that Routing is turned on Raspberry PI.

Enable IP Forwarding;

sudo nano /etc/sysctl.conf

Add following line

net.ipv4.ip_forward=1

Then run

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

The iptables to allow traffic would be something like

sudo iptables -A FORWARD -i vpn_se -o eth0 -j ACCEPT sudo iptables -A FORWARD -i eth0 -o vpn_se -j ACCEPT

References: https://raspberrypihq.com/how-to-turn-a-raspberry-pi-into-a-wifi-router/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.