The Blog

Sharing Internet Connection in Ubuntu Posted on

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

# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE

where ethX is the network card that the Internet is coming from

# echo 1 > /proc/sys/net/ipv4/ip_forward

Install dnsmasq and ipmasq using the following command

# apt-get install dnsmasq ipmasq

Restart dnsmasq using the following command

# /etc/init.d/dnsmasq restart

Reconfigure ipmasq to start after networking has been started

# dpkg-reconfigure ipmasq

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

# iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE

where ethX is the network card that the Internet is coming from

# echo 1 > /proc/sys/net/ipv4/ip_forward

Add the line “net.ipv4.ip_forward = 1″ to /etc/sysctl.conf

# gedit /etc/sysctl.conf

Reboot your system is optional.

This entry was posted in Uncategorized. Bookmark the permalink.

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *



CAPTCHA
Change the CAPTCHA codeSpeak the CAPTCHA code