Page 1 of 1

How to connect Ubuntu to internet?

Posted: Thu Oct 26, 2006 1:02 am
by obsidian
I'm a total *nix noob.

I have an Ubuntu box hooked up to a WinXP box via network cable. The WinXP box connects to the Internet via a Linksys wireless card to a wireless router.

So, how do I set up Ubuntu to connect to the Internet through the XP box?

Posted: Thu Oct 26, 2006 1:05 am
by Foo
Is the XP box already set up for connection sharing?

Posted: Thu Oct 26, 2006 1:31 am
by obsidian
Well, I have the network bridge set up in XP if that's what you mean. And the XP machine's internet works fine.

I have Ubuntu plugged into WinXP with a crossover cable. On XP, Under network connections I selected the Wireless Network and Local Area Connections together and right-click, Bridge Connections.

Not sure what else I have to do.

Edit... Okay, disabled network bridge and instead, on the Wireless Network Connection, I checked the "Allow other network users to connect through this computer's Internet connection" flag.

Still not sure what to do.

Posted: Thu Oct 26, 2006 10:13 am
by Foo
If you bridge a connection on an XP machine, and it's working correctly, then the XP machine itself loses all connectivity to the networks you're bridging.

Hence that's not an appropriate solution.

Now you've enabled internet connection sharing, check out the help files for ICS on microsoft.com and your XP machine, they should make things quite clear.

I think the general gist of what you do is give both machines manual Ip addresses so they can operate correctly as a network, then set the 'default gateway' address on the ubuntu box to the address of the XP machine, hence routing all traffic through the XP machine.

Posted: Thu Oct 26, 2006 10:37 am
by 4days
what foo said - but if you've got a spare machine, try connecting to your gateway box with another xp before ubuntu - just to make sure it's definitely working.

Posted: Thu Oct 26, 2006 5:12 pm
by obsidian
Well, the Ubuntu machine also has WinXP installed on a different partition, and the internet seems to work connecting from XP machine to XP machine. So the trouble is just getting the internet working on Ubuntu to XP.

Here are my current settings in Ubuntu:

Under System > Network Settings > Ethernet Connection...
Configuration: Static IP Address
IP address: 192.168.1.5
Subnet Mask: 255.255.255.0
Gateway Address: 192.168.1.4

Settings on WinXP:

Ethernet adapter Wireless Network Connection:
Connection-specific DNS Suffix . : grnsbr.phub.net.cable.rogers.com
IP Address. . . . . . . . . . . . : 192.168.1.4
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Posted: Thu Oct 26, 2006 5:16 pm
by Foo
On your ubuntu box, set the IP address to 192.168.0.2
subnet 255.255.255.0
gateway 192.168.0.1

And this should go some way to explaining why:
Image

The details for each connection I've put in the appropriate place. The red arrows represent the 'links' by which your ubuntu box would reach the internet, and the numbers at each end of the arrow need to be the same for the link to be made. Currently the gateway value on the ubuntu box isn't pointing at the ip address of the windows box.

Posted: Thu Oct 26, 2006 6:12 pm
by obsidian
LOL... nice picture. Don't have the time now, but I'll give it a go later tonight.

Posted: Fri Oct 27, 2006 4:11 am
by obsidian
Hmm... I can now ping my router, but still can't get internet working with the Ubuntu partition. The windows partition on the same box works fine.

Posted: Fri Oct 27, 2006 9:17 pm
by ^misantropia^
Can you ping for example 64.233.187.99 (google.com)? If so, it's a matter of adding the address of your DNS server to /etc/resolv.conf (`man resolv.conf`).

Posted: Sat Oct 28, 2006 3:23 am
by obsidian
That did the trick! Thanks everyone.