How to set up internet access in Fedora


I have just been given a couple of PC's and thought I might set one up as a linux box to run test web sites and databases etc, purely for development. However being a .net developer, I don't know the first thing about linux.

I downloaded Fedora 10 and it has installed and I have set up a static IP address, with the same gateway as the Windows PC's on my network and I can get websites running on my network, but I cannot access the internet on the Linux box.

I have a feeling that this maybe something to do with the DNS settings, which originally I had set the same as the Windows PC's, but this did not work, I then changed them to the DNS settings given to me by my ISP, again with no joy.

Any help gratefully received.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

fosiul01Connect With a Mentor Commented:
hmmm It looks ODD!!

if your subnet mask is then

this line should be

inet addr Bcast: Mask:  -> inet addr Bcast: Mask:

also, route -n output is odd aswell                 U           1            0       0        eth0

how did you add your IP in the sytem ?? is this via dhcp or static ??
yes, it is

in Fedora

go to

cd /etc/
vi resolv.conf

type your dns address here like this

nameserver ip_of_dns_server

Save the file

now you would be able to browswe
TobyBushAuthor Commented:
Thanks for that, but when I opened the file the line for the the nameserver was already there with the IP address I had set up in the Network Configuration tool. Also, when I try and save the file it tells me that I do not have permission to do this, and I'm not too sure how to change to the administrator user...? (Like I say, Linux virgin)

When I try and browse with Firefox, I get a "Failed to connect", "the connection was refused when attempting to contact"

Does this give any clues?

The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

To change to the admin user open up a terminal and type "su" then give it the root password.

Can you ping sites by IP rather than name?
TobyBushAuthor Commented:
It would appear that I cannot ping external IP addresses, but I can from my Windows PC.
type "ip addr" and "ip route" to view the ip and routing information. Is it all correct?  Can you ping your gateway?
TobyBushAuthor Commented:
I can ping my gateway.

ip addr looks about correct (from my little experience) - is there anything I should be looking out for?

ip route also looks OK (but I have no idea what it means)

Sorry yesterday i was out for whole day could not able to reply

You saying :

1. Nameserver is in /etc/resol.v.conf file and its correct

2. You can ping gateway pc


1. can you ping your Nameserver Ip ??
TobyBushAuthor Commented:

No porbs for the delay, I am not in any hurry. And thanks for the reply.

Now I maybe sounding very dumb here, but with all my Windows PC's the Nameserver and the gateway IP's are the same. (in this case - This network was origianl set up as a network by my old company, with whom I parted company last year and I am not too interested in talking to them... :-)

I can ping (I can dig external sites, but only if I prefix with "@")

Also, is there a way I can check the subnet mask? I originally set it to, but whenever I look at the device config for etho it has an IP address (

Ok to check subnet mask


it will show you the subnet mask like this

 inet addr:  Mask:  

also check the route -n command
it will show you Gateway , and subnet mask

like this

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth0   ----------------------     U     0      0        0 eth0         UG    0      0        0 eth0   --------------------------------------

TobyBushAuthor Commented:

ifconfig comes back with:
inet addr Bcast: Mask:
(this doesn't sound right??)

route -n shows (for eth0 - and I am typing this in manually)
Destination       Gateway             Genmask        Flags     Metric     Ref    Use    IFace                  U           1            0       0        eth0               UG         0           0       0        eth0
(this also doesn't look right, but I don't know anything about linux)

Also, it comes back with "pan0" and I have no idea what this is!

Many thanks (off out for a couple of hours now)
Roachy1979Connect With a Mentor Commented:
Hi Toby - as fosiul01 says - it's almost definitely an ip address configuration issue looking at your routing table.

There are a couple of different ways of configuring your IP settings in Fedora.....either via the gui or via the command is often good to understand both.

To change your ip address at the command line first you need to switch to a root user using su

Then type

ifconfig eth0

(the /24 denotes a 24 bit subnet mask which is the same as

You then need to configure your default gateway using

route add default gw

You should then be able to ping the gateway and any public IP's.  If you check resolv.conf and the nameserver is correct you should also be able to ping external addresses, such as by name...

To configure network settings using a GUI you can go to a command line and switch to root (su) then type system-config-network.  You can then edit the network settings....

Yeah, those numbers are way off....try these commands to fix it:

ifconfig eth0 down
ifconfig eth0 netmask boardcast
ifconfig eth0 up
TobyBushAuthor Commented:
Thanks guys, it all works now!

Roachy1979 I ran your two lines of code and checked the DNS servers line was in resolv.conf and I got access to the internet.

I have split the points as both Roachy1979 & fosiul01 were of great help.

Thanks again
If that works, edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file for those values, that'll ensure they stick on reboots
All Courses

From novice to tech pro — start learning today.