I'm trying to use a raspberry to connect a terminal device to a VLAN. Basically I need to reach a device (that I cannot directly connect to a VLAN) remotely.
My idea is to connect the device (via eth) to a raspberry, join the raspberry to a VLAN and then proxy all the traffic between the VLAN and the device. I'm interested in proxy all and only ipv6 connections (tcp and udp).
Network configuration is:
( Device ) ( Raspberry ) ( Laptop that need access )
DEVICE_IP <-----eth0-----> RASP_IP RASP_VLANIP <----- VLAN ham0 ------> PC_VLANIP
I have set up the VLAN between the raspberry and the laptop using Hamachi. Then I have setup the following iptables rules:
ipt6 --in-interface ham0 --append PREROUTING --table nat --destination $RASP_VLANIP --jump DNAT --to-destination $DEVICE_IP
ipt6 --append POSTROUTING --table nat --destination $RASP_IP --jump SNAT --to-source $PC_VLANIP
I have then used iperf3 to test connectivity launching on the device and then trying to connect to it from the laptop using the address RASP_VLANIP. Anyway i get the error: iperf3: error - unable to connect to server: Connection refused
What am I doing wrong?
Additional info:
net.ipv4.ip_forward = 0
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.eth0.forwarding = 1
net.ipv6.conf.wlan0.forwarding = 1
net.ipv6.conf.ham0.forwarding = 1
pi@raspi:~ $ ip -6 neigh show
fe80::213d:e705:e749:7a8f dev eth0 lladdr --:--:--:--:-- STALE
fe80::f079:e6fa:2c56:4984 dev eth0 lladdr --:--:--:--:-- STALE <--DEVICE_IP
2620:9b::1946:6064 dev ham0 lladdr --:--:--:--:-- STALE <--PC_VLANIP
pi@raspi:~ $ ifconfig
eth0:
inet6 fe80::213d:e705:e749:7a8f <--RASP_IP
ham0:
inet6 fe80::7879:19ff:fe22:e039 <--RASP_VLANIP
wlan0:
inet6 fe80::8cff:42dc:7fba:3289