![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2005
Location: Australia
Beans: 81
|
Hello,
The following will explain how to share your Internet connection: Note: Type all the following commands in a root terminal, DO NOT use sudo. 1. 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) 2. 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 3. Install dnsmasq and ipmasq using apt-get: # apt-get install dnsmasq ipmasq 4. Restart dnsmasq: # /etc/init.d/dnsmasq restart 5. Reconfigure ipmasq to start after networking has been started: # dpkg-reconfigure ipmasq 6. Repeat steps 1 and 2. 7. Add the line "net.ipv4.ip_forward = 1" to /etc/sysctl.conf # gedit /etc/sysctl.conf 8. Reboot. (Optional) I hope this helps. Good luck! Last edited by anaoum; January 29th, 2006 at 11:33 PM.. Reason: update |
|
|
|
|
|
#2 |
|
First Cup of Ubuntu
![]() Join Date: Nov 2005
Location: Finland
Beans: 2
Ubuntu Breezy 5.10
|
Re: Howto Share internet connection
By following your instructions (after a long while spent at the ages-old art of trial-and-error
eth0 connects me to the Internet. eth2 connects me to my winxp machine. ping gets reply both ways and my winxp is hosting ftp server which is reachable. winxp firewall is disabled (just in case) Xp machine, however, does NOT reach Internet. Possible reason for this could be in the way I've set up the xp machine's networking. You did not give specifics as to how those should be set up, but I've tested both fixed ip and DHCP. Also, the networking adapters and cables im using are reliable... Any ideas? -Squirreli PS. I do have a slight virus problem on the XP machine's lsass.exe, but it connects to Internet just fine when there's no linux box between it and the Internet, so I don't believe that to be the trouble. |
|
|
|
|
|
#3 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2005
Location: Australia
Beans: 81
|
Re: Howto Share internet connection
Hello,
On your winxp machine configure it with a static ip (make it similar to the ip on your server. eg if server ip is 192.168.0.1, then make your ip 192.168.0.10). Also make sure that you set the "Default Gateway" and "Preffered DNS" to the ip on your ubuntu machine (the one that's sharing the internet connection). It should work fine after that. Good luck Last edited by anaoum; November 18th, 2005 at 04:50 PM.. |
|
|
|
|
|
#4 |
|
First Cup of Ubuntu
![]() Join Date: Nov 2005
Location: Finland
Beans: 2
Ubuntu Breezy 5.10
|
Re: Howto Share internet connection
Ha! Now it works.
Setting default gateway didn't help, but didn't do any harm either. Setting preferred DNS server did the trick... So, these XP comp tcp/ip settings made it work. -fixed ip:192.168.0.1 (subnet mask 255.255.255.0) -default gateway:192.168.0.2 -preferred DNS server:192.168.0.2 Paljon kiitoksia/Thank you very much -Squirreli |
|
|
|
|
|
#5 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2005
Location: Australia
Beans: 81
|
Re: Howto Share internet connection
No worries. I'm glad it has helped!
|
|
|
|
|
|
#6 |
|
A Carafe of Ubuntu
![]() |
Re: Howto Share internet connection
I'm having some fun with this -
set up is a PPC laptop that needs the internet from a x86 desktop (which gets the internet with ath0 , a wifi adapter, and is sharing with eth0), both running Breezy. Is it a matter of just changing Network settings? So far, the laptop can ping x86 when static IP and DNS is set to the x86 IP (192.168.0.2), but cant get to the internet. Also x86 cant get to the internet while eth0 is activated . Should I also change submasks? PLUS when I restart dnsmasq I get : Restarting DNS forwarder and DHCP server: dnsmasqstart-stop-daemon: warning: failed to kill 8006: Operation not permitted rm: cannot remove `/var/run/dnsmasq.pid': Permission denied dnsmasq: failed to bind listening socket: Permission denied (failed to start). I'm also using a crossover cable - thats right isnt it? |
|
|
|
|
|
#7 |
|
Just Give Me the Beans!
![]() Join Date: Jun 2005
Location: Australia
Beans: 81
|
Re: Howto Share internet connection
Hello nicholaspaul,
Make sure that the subnet masks on your ppc are set to 255.255.255.0. Also make sure that the Default Gateway on the ppc is set to the ip of the x86 (192.168.0.2) About restarting dnsmasq, are you sure you are executing the command as root user? |
|
|
|
|
|
#8 |
|
A Carafe of Ubuntu
![]() |
Re: Howto Share internet connection
Hi anaoum
Yea... So the full story is: x86 ath0: Static IP: 192.168.0.102 Subnet: 255.255.255.0 Gateway Address: 192.168.0.1 [the address of my wireless router] eth0: Static IP: 192.168.0.2 Subnet: 255.255.255.0 Gateway Address: 192.168.0.1 Default Gateway Device: ath0 PPC Laptop eth0: Static IP: 192.168.0.2 Subnet: 255.255.255.0 Gateway Address: 192.168.0.2 DNS: 192.168.0.102 Search domain: home (the name of the intranet) --------------------------------------------------- Should I change search domains on the PPC? |
|
|
|
|
|
#9 | |
|
A Carafe of Ubuntu
![]() |
Re: Howto Share internet connection
Quote:
|
|
|
|
|
|
|
#10 |
|
Dark Roasted Ubuntu
![]() Join Date: Nov 2004
Location: Purdue University, Indiana
Beans: 817
Dapper Drake Testing/
|
Re: Howto Share internet connection
The Firestarter firewall can do all of this for you, by the way...
Code:
sudo apt-get install firestarter In its preferences, set "internet connected device" to the internet, and "local network device" to the local device. Then enable NAT and DHCP if you want... |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|