Solved

How to set up internet access in Fedora

Posted on 2009-04-08
15
606 Views
Last Modified: 2012-05-06
Hi

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.
T
0
Comment
Question by:TobyBush
  • 6
  • 4
  • 4
  • +1
15 Comments
 
LVL 29

Expert Comment

by:fosiul01
ID: 24095747
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
0
 

Author Comment

by:TobyBush
ID: 24096298
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 www.website.com..."

Does this give any clues?

T
0
 
LVL 26

Expert Comment

by:jar3817
ID: 24096713
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?
0
 

Author Comment

by:TobyBush
ID: 24096800
It would appear that I cannot ping external IP addresses, but I can from my Windows PC.
0
 
LVL 26

Expert Comment

by:jar3817
ID: 24096820
type "ip addr" and "ip route" to view the ip and routing information. Is it all correct?  Can you ping your gateway?
0
 

Author Comment

by:TobyBush
ID: 24096989
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)

Cheers
T
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 24104924
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

Ok

1. can you ping your Nameserver Ip ??
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:TobyBush
ID: 24105272
Hi,

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 192.168.207.254) - 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 192.168.207.254. (I can dig external sites, but only if I prefix with "@192.168.207.254")

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

Cheers
Toby
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 24105319
Ok to check subnet mask

ifconfig

it will show you the subnet mask like this

 inet addr:192.168.1.3Bcast192.168.1.255  Mask:255.255.255.0  

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
192.168.1.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0   ----------------------
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         192.168.1.1   0.0.0.0         UG    0      0        0 eth0   --------------------------------------





0
 

Author Comment

by:TobyBush
ID: 24105367
OK,

ifconfig comes back with:
inet addr 192.168.207.135 Bcast:255.255.255.255 Mask: 192.0.0.0
(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
192.0.0.0         0.0.0.0                  192.0.0.0          U           1            0       0        eth0
0.0.0.0            192.168.207.245    0.0.0.0             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)
Toby
0
 
LVL 29

Accepted Solution

by:
fosiul01 earned 125 total points
ID: 24105391
hmmm It looks ODD!!


if your subnet mask is 255.255.255.0 then

this line should be

inet addr 192.168.207.135 Bcast:255.255.255.255 Mask: 192.0.0.0  -> inet addr 192.168.207.135 Bcast:255.255.255.255 Mask: 255.255.255.0

also, route -n output is odd aswell

192.0.0.0         0.0.0.0                 192.0.0.0          U           1            0       0        eth0

how did you add your IP in the sytem ?? is this via dhcp or static ??
0
 
LVL 14

Assisted Solution

by:Roachy1979
Roachy1979 earned 125 total points
ID: 24106386
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 line......it 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 192.168.207.35/24

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

You then need to configure your default gateway using

route add default gw 192.168.207.254

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 google.com 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....


0
 
LVL 26

Expert Comment

by:jar3817
ID: 24106452
Yeah, those numbers are way off....try these commands to fix it:

ifconfig eth0 down
ifconfig eth0 192.168.207.135 netmask 255.255.255.0 boardcast 192.168.207.255
ifconfig eth0 up
0
 

Author Closing Comment

by:TobyBush
ID: 31567960
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
Toby
0
 
LVL 26

Expert Comment

by:jar3817
ID: 24106574
If that works, edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file for those values, that'll ensure they stick on reboots
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now