0
Device A (PLC, static IP=10.10.10.11) 
        |
        | eth0 connection 
        |
Device B (raspberry B 3,  Jessie)
        |
        | OpenVPN  
        |
Device C (laptop, Windows 8.1)

I am trying above setup.

The thing is Device B and Device C are OpenVPN clients connected to same OpenVPN access server.

My IP configurations are:

(Device A) PLC ---> 10.10.10.11 
(Device B)R-pi ---> 
cat /etc/dhcpcd.conf 

interface eth0 
static ip_address=10.10.10.10/24 
static domain_name_servers=192.168.1.1

VPN network IP= 10.8.0.2
(Device C) Windows 8.1 --->
VPN network IP= 10.8.0.5

I have enabled Static routes on router.

But I am unable to even ping Device A from Device C.

So what else should I change for this to work?

Output of:

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:ef:04:1b brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.10/24 brd 10.10.10.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::e52b:ccb0:7b56:f2ea/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:ba:51:4e brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.53/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::88a6:314a:4819:9fd1/64 scope link 
       valid_lft forever preferred_lft forever
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    link/none 
    inet 10.8.0.5/20 brd 10.8.15.255 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::5c34:f7d7:fb58:c10c/64 scope link flags 800 
       valid_lft forever preferred_lft forever

And Output of

ip route
default via 192.168.1.1 dev wlan0  metric 303 
10.8.0.0/20 dev tun0  proto kernel  scope link  src 10.8.0.5 
10.10.10.0/24 via 10.8.0.1 dev tun0  metric 101 
10.10.10.0/24 dev eth0  proto kernel  scope link  src 10.10.10.10  metric 202 
172.27.224.0/20 via 10.8.0.1 dev tun0  metric 101 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.53  metric 303 
192.168.1.1 via 10.8.0.1 dev tun0  metric 101 
192.168.31.0/24 via 10.8.0.1 dev tun0  metric 101 
  • What is a PLC ? – Ingo May 25 at 16:26
  • Siemens S7-200 Smart – Spriya May 27 at 5:13
  • I just discovered, I can't ping my PLC from Raspberry Pi when connected to VPN. – Spriya May 27 at 7:34
  • What is Siemens S7-200 Smart? Does it is a Desktop computer? If you can't ping the PLC(?) when VPN is connected then it seems to be a typical routing problem. Please execute these two commands on the RasPi: ip addr and ip route. Edit your question and copy and paste the output into it. – Ingo May 27 at 8:37
  • Siemens S7-200 Smart is PLC (Programmable Logic Controller). It does not have Desktop. Its a micro-controller. – Spriya May 27 at 10:20
0

You wrote that "Device B and Device C are OpenVPN clients connected to same OpenVPN access server". That is important because only the server can route traffic between the clients that are connected to it. So configure the server to forward ip packets on its (pseudo) interfaces and manage its routing table so traffic goes where you want. As far as I know the OpenVPN server has an option to set that clients can talk to each other.

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.