[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

How to set up internet access in Fedora

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
TobyBush
Asked:
TobyBush
  • 6
  • 4
  • 4
  • +1
2 Solutions
 
fosiul01Commented:
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
 
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 www.website.com..."

Does this give any clues?

T
0
 
jar3817Commented:
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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
TobyBushAuthor Commented:
It would appear that I cannot ping external IP addresses, but I can from my Windows PC.
0
 
jar3817Commented:
type "ip addr" and "ip route" to view the ip and routing information. Is it all correct?  Can you ping your gateway?
0
 
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)

Cheers
T
0
 
fosiul01Commented:
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
 
TobyBushAuthor Commented:
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
 
fosiul01Commented:
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
 
TobyBushAuthor Commented:
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
 
fosiul01Commented:
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
 
Roachy1979Commented:
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
 
jar3817Commented:
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
 
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
Toby
0
 
jar3817Commented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 6
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now