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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?

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?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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)
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 ??

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.