How to connect Ubuntu to internet?

Locked
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

How to connect Ubuntu to internet?

Post 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?
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post by Foo »

Is the XP box already set up for connection sharing?
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post 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.
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
4days
Posts: 5465
Joined: Tue Apr 16, 2002 7:00 am

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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 . . . . . . . . . :
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

LOL... nice picture. Don't have the time now, but I'll give it a go later tonight.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post 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`).
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

That did the trick! Thanks everyone.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Locked