softganz's blog
How to Share internet connection in Ubuntu
My home have 3 computer. I want to share internet for all computer.
I search from internet and found Howto Share internet connection from http://ubuntuforums.org.
Following this step and it work!!!!!!
Note: Type all the following commands in a root terminal, DO NOT use sudo.
- 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)
My note : My ethX was eth1 and ip was 192.168.1.1
- 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 apt-get:
apt-get install dnsmasq ipmasq
- Restart dnsmasq:
/etc/init.d/dnsmasq restart
- Reconfigure ipmasq to start after networking has been started:
dpkg-reconfigure ipmasq
Repeat steps 1 and 2.
Add the line "net.ipv4.ip_forward = 1" to /etc/sysctl.conf
gedit /etc/sysctl.conf
- Reboot. (Optional)
After reboot , It's work and I set Windows XP on VMware 2Beta to use this share by set DNS to my ISP.
Everything OK!!!!!
Thank for anaoum from http://ubuntuforums.org very much.
From : http://ubuntuforums.org
