![]() |
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 30th, 2006 at 12:33 AM.. 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 |
|
First Cup of Ubuntu
![]() Join Date: Nov 2006
Beans: 2
|
Re: Howto Share internet connection
ok i spent hours trying to do all this, my situation is a bit more complicated, i use evdo card as my internet, can you please tell me how to undo all these settings for the ethernet interface?
thanks |
|
|
|
|
|
#4 |
|
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 05:50 PM.. |
|
|
|
|
|
#5 |
|
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 |
|
|
|
|
|
#6 |
|
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!
|
|
|
|
|
|
#7 |
|
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? |
|
|
|
|
|
#8 |
|
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? |
|
|
|
|
|
#9 | |
|
First Cup of Ubuntu
![]() Join Date: Nov 2005
Beans: 6
|
Re: Howto Share internet connection
Quote:
Hello Kinda still new on this so i hope ud help me as well on this. Im connected to a wifi/DSL line with gives me a Dynamic IP to my ubuntu (internet sharing server). I followed the earlier post and it did installed everything i hope. This Ubuntu PC connects to the internet nicely but my Winxp and other Linux PC wont have any access yet. Probably still having problems with what is the right settings I should set up on those workstations? My eth1=connects to the DSL (set to DHCP), Default gateway eth0= connects to the LAN network (set to DHCP) what should I set in for the Winxp Lan card? How can I get /validate the DNS server and or the Gateway? Thanks a lot! hope this post is understandable... mybers |
|
|
|
|
|
|
#10 | |
|
A Carafe of Ubuntu
![]() |
Re: Howto Share internet connection
Quote:
|
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|