Port forwarding in network namespace
I need help with my little setup.
I have a VM on my PC with Ubuntu 16.04.3 LTS.
My home network 192.168.1.0/24.
Many network namespaces with OpenVPN tunnels working.
Some software that works inside netns.
What I need is to control that software from my home network by using web interface.
My VM’s eth0 ip is 192.168.1.17, one of my netns veth ip is 10.1.8.1
I run a web service on port 1008 and I want to access it from 192.168.1.0 network going to 192.168.1.17:1008.
I can test the service from inside VM’s 192.168.. network using curl and it works alright, I can access the service by 10.1.8.1:1008.
I also can ping 10.1.8.1 from my home network, but I can’t access the web service outside the VM. It refuses the connection.
I tried to port forward any incoming connections to port 1008 to 10.1.8.1:1008 using iptables, but it doesn’t seem to work. Port forwarding is enabled in system.