<div dir="ltr"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Hi</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I have a question about networking on openstack. I try to create 2 network segment using vm ubuntu. It has 2 networking cards <a href="http://192.168.1.0/24" target="_blank">192.168.1.0/24</a> and <a href="http://192.168.2.0/24" target="_blank">192.168.2.0/24</a>. I configured nat rules using iptables but it doesnt work as i expected. When i try to ping from <a href="http://192.168.2.0/24" target="_blank">192.168.2.0/24</a> to <a href="http://192.168.1.0/24" target="_blank">192.168.1.0/24</a> network, ubuntu server gets packet but cannot forward the other site ?</div><div style="font-family:arial,sans-serif;font-size:13px">I
googled but cannot find any solution. So how can i configure nat
properly on ubuntu vm ? I configured the sysctl for ip_forwarding and
iptables rules. </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I
can verify that ping packet from Machine2 reaches the Machine1 but
Machine2 ping reply doesn't come to Machine1. The reply packet come to
Ubuntu's interface 192.168.1.5 but the nat rule does not work.</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">Below is the rules i did. eth0 external network, eth1 internal network. </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">echo 1 > /proc/sys/net/ipv4/ip_forward</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</div><div style="font-family:arial,sans-serif;font-size:13px">iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT</div><div style="font-family:arial,sans-serif;font-size:13px">iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Best regards</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><img class="" src="cid:ii_148558ce19616cbb" alt="Satır içi resim 2" height="316" width="562"></div></div></div>