{"id":142,"date":"2011-02-05T00:18:33","date_gmt":"2011-02-05T00:18:33","guid":{"rendered":"http:\/\/xbmc\/wordpress\/?p=142"},"modified":"2011-08-14T11:31:17","modified_gmt":"2011-08-14T16:31:17","slug":"sharing-internet-connection-in-ubuntu","status":"publish","type":"post","link":"https:\/\/xfloyd.net\/blog\/?p=142","title":{"rendered":"Sharing Internet Connection in Ubuntu"},"content":{"rendered":"<p>Start by configuring the network card that interfaces to the other computers on you network<\/p>\n<p># ifconfig ethX ip<\/p>\n<p>where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used)<\/p>\n<p>Then configure the NAT as follows<!--more--><\/p>\n<p># iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE<\/p>\n<p>where ethX is the network card that the Internet is coming from<\/p>\n<p># echo 1 &gt; \/proc\/sys\/net\/ipv4\/ip_forward<\/p>\n<p>Install dnsmasq and ipmasq using the following command<\/p>\n<p># apt-get install dnsmasq ipmasq<\/p>\n<p>Restart dnsmasq using the following command<\/p>\n<p># \/etc\/init.d\/dnsmasq restart<\/p>\n<p>Reconfigure ipmasq to start after networking has been started<\/p>\n<p># dpkg-reconfigure ipmasq<\/p>\n<p>Start by configuring the network card that interfaces to the other computers on you network<\/p>\n<p># ifconfig ethX ip<\/p>\n<p>where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used)<\/p>\n<p>Then configure the NAT as follows<\/p>\n<p># iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE<\/p>\n<p>where ethX is the network card that the Internet is coming from<\/p>\n<p># echo 1 &gt; \/proc\/sys\/net\/ipv4\/ip_forward<\/p>\n<p>Add the line \u201cnet.ipv4.ip_forward = 1\u2033 to \/etc\/sysctl.conf<\/p>\n<p># gedit \/etc\/sysctl.conf<\/p>\n<p>Reboot your system is optional.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Start by configuring the network card that interfaces to the other computers on you network # ifconfig ethX ip where ethX is the network card and ip is your desired server ip address (Usually 192.168.0.1 is used) Then configure the NAT as follows<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/142"}],"collection":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142"}],"version-history":[{"count":1,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}