Dear networking experts
I have an Ubuntu 18.04 instance in a cloud (say A), that is assigned a public ip address an can be logged in from internet, however its only network interface is private:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether d0:0d:5d:03:3c:17 brd ff:ff:ff:ff:ff:ff inet 10.0.1.17/24 brd 10.0.1.255 scope global eth0 I understand that the cloud provider is doing the NAT for me.
Now I have another VM, say B, without such NAT in the same private subnet, and B can't be accessed from internet, neither can B reach public servers.
Now, I would like to use A as a NAT or router to access internet from B. I assume that if I can reach internet from A, then I can somehow set it up to forward traffic from B.
However traditional NAT recipes for A (such as in man ufw-framework) don't seem to work for me, since I guess they assume that A should have a real public IP on an interface.
So, the question is - is it possible to provide B with internet via A in the setup I described?
Thanks in advance!