I've got a CentOS 7 VM host at 192.168.0.9. It serves up the subnet 192.168.122.0/24. Ip forwarding has been set up on this host.
If I shut off firewalld on 192.168.0.9, it goes through no problem.
Code: Select all
net.ipv4.ip_forward = 1
I've got another machine on my network at 192.168.0.3 which is a real machine that can ping and ssh into the 0.9 machine. I've added a static route to my 0.3 machine as follows:
Code: Select all
ip route add 192.168.122.0/24 via 192.168.0.9 dev enp5s0
Which allows me to ping the 192.168.122.1 IP.
However, I cannot access any of the machines that are beneath this subnet.
Code: Select all
sudo traceroute 192.168.122.142
traceroute to 192.168.122.142 (192.168.122.142), 30 hops max, 60 byte packets
1 192.168.0.9 (192.168.0.9) 0.166 ms 0.155 ms 0.313 ms
2 192.168.0.9 (192.168.0.9) 0.306 ms 0.300 ms 0.296 ms
Code: Select all
ssh 192.168.122.142
ssh: connect to host 192.168.122.142 port 22: Connection refused
Code: Select all
ping 192.168.122.142
PING 192.168.122.142 (192.168.122.142) 56(84) bytes of data.
From 192.168.0.9 icmp_seq=1 Destination Port Unreachable
From 192.168.0.9 icmp_seq=2 Destination Port Unreachable
I've also added the following to the 122.142 VM:
Code: Select all
ip route add 192.168.0.0/24 via 192.168.122.1
I'm able to ssh FROM the 122.142 VM to the machines in the 0.0/24 subnet, but not the other way around.