{"id":2626,"date":"2014-10-30T15:18:52","date_gmt":"2014-10-30T21:18:52","guid":{"rendered":"http:\/\/benincosa.com\/blog\/?p=2626"},"modified":"2014-11-19T11:23:55","modified_gmt":"2014-11-19T17:23:55","slug":"ip-masquerading-nat-in-red-hat","status":"publish","type":"post","link":"https:\/\/benincosa.com\/?p=2626","title":{"rendered":"IP Masquerading (NAT in Red Hat)"},"content":{"rendered":"<p>In my lab I have a server that is dual homed. \u00a0It is connected to the outside network on one interface (br0) and the internal network (br1) is connected to the rest of my VM cluster.<\/p>\n<p>I want the VMs to be able to get outside. \u00a0So the way I did that (on RedHat) was to create a few IP table rules. \u00a0I&#8217;ve been doing this for 10+ years now, but keep forgetting syntax.<\/p>\n<p>So here it is:<\/p>\n<pre># iptables -A FORWARD -i br1 -j ACCEPT\r\n# iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE<\/pre>\n<p>Then, of course, you have do enable forwarding in the \/etc\/sysctrl.conf<\/p>\n<pre>net.ipv4.ip_forward = 1<\/pre>\n<p>Finally, run <\/p>\n<pre>sysctl -p<\/pre>\n<p>for those changes to take effect. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my lab I have a server that is dual homed. \u00a0It is connected to the outside network on one interface (br0) and the internal network (br1) is connected to the rest of my VM cluster. I want the VMs to be able to get outside. \u00a0So the way I did that (on RedHat) was&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[920],"tags":[477,11],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/2626"}],"collection":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2626"}],"version-history":[{"count":1,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/2626\/revisions"}],"predecessor-version":[{"id":2627,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/2626\/revisions\/2627"}],"wp:attachment":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}