Routing by linux iptables -
i have 3 virtual machines called vm1 vm2 , vm3. want ping vm1 vm3 via vm2. vm1 has interface eth0 having ip adress 192.168.221.10. similarly, vm3 has eth0 having ip adress 192.168.221.11. vm2 has 2 interfaces eth1 (192.168.221.1 ) , eth2 (192.168.221.2). want control connections on vm2 , route them commands below
sudo iptables -t nat -a prerouting -i eth2 -j dnat --to 192.168.221.1 sudo iptables -t nat -a prerouting -i eth1 -j dnat --to 192.168.221.11
however cannot reach vm3 vm1 in way. idea of problem. lot.
make sure have enabled ip forwarding on vm2 vm2 acting router.
i've posted article on how configure ubuntu router using iptables.
Comments
Post a Comment