Go Premium for a chance to win a PS4. Enter to Win


Problem connecting internet and networking 2 computers runninb Ubuntu

Posted on 2006-11-19
Medium Priority
Last Modified: 2013-12-15
I have installed 2 computers with Ubuntu.

On the primary computer running Ubuntu, when i type http://www.google.co.in it shows a message that unable
to lookup the site so i am unable to surf the net.

Only once i was able to surf the net through the same computer.

Q1. I was unable to connect to the internet
I checked a few setting using as root:
/sbin/ifconfig -a and it showed the ip address, broadcast address and net mask appropriately set. for eth0
netstat showed all the configured ports.
I was able to successfully ping the network card. and /etc/resolv.conf showed me the ip address of the dns server

I was able to surf the internet from Microsoft XP running on the same pc.

To my surprise, /etc/sysconfig directory was no where to be found in the entire system.
Also, I could not find ifcfg-eth0, /etc/dhcpcd files anywhere in the system using locate or find commands.

Why Are system files that are present in Red Hat not present in Ubuntu and why am i not able to connect to web?

Q2: The other computer running Ubuntu runs internet only when the primary computer is running Microsoft XP, if the primary computer runs Ubuntu it cannot surf the net.

Question by:aman_greval
  • 8
  • 7

Expert Comment

ID: 17980482
I'll write my solution to connect internet. I didn't use terminal for networking configuration.

first check the connection to your router. ping your adsl router/or whatever it is.

if it's ok, ubuntu has a networking tool.

click System-Administration-Networking

give your eth0 a proper static ip, gateway and dns address.

and then check again. try to ping gateway, dns server... and nslookup the site.


Author Comment

ID: 18000173
As i mentioned, i have used ping and it is successfully pinging the router.

And also that once i was able to successfully connect to the internet.

I also peeked into the network configuration using /sbin/ifconfig -a and it showed me IP, Subnet and NetMask configured

Expert Comment

ID: 18000516
and dns server? does it show your router as dns?

sometimes i couldn't resolve addresses, i don't know why.

but now i changed my dns server ip to my isp's dns servers.. and everything's fine now..
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.


Author Comment

ID: 18000918
"and dns server? does it show your router as dns?"
How do i do this?? In front-end or back-end command

Expert Comment

ID: 18003319
the file that keeps your nameservers


edit it, and check the nameserver entries

if there's only one entry for nameserver showing your router ip
then add an additional

nameserver yourisp'sdnsserverIP

or you can change the original with this one..

use the fastest possible dns server

to determine the fastest ping them and look at the reply seconds.. the lowest is the best..

if you can't find your isp's dns server IPs, check them at your router configuration page.

you don't use dhcp i think? so make sure to fill the right ones into your resolv.conf

Expert Comment

ID: 18004011
also check this link,there's a good tutorial.. it's a better solution for dns lookups, and make your connections faster than before..


Author Comment

ID: 18019820
Is the ip address given by the ISP same as the dns server.

1. I inserted this ip address in /etc/resolv.conf
There was only one dnsname the /etc/resolv.conf file, the default one
i added
saved the file

and rebooted the computer and entered http://www.google.co.in in the address bar of firefox
but the google page was not loaded.

I guess it might be either because i am using the wrong dns address

2.As you said "if you can't find your isp's dns server IPs, check them at your router configuration page."
how can i reach the router configuration page?

Author Comment

ID: 18020246
Can you tell me how do i switch off the firewall in ubuntu

Author Comment

ID: 18024466
I have seen the /etc/resolv.conf file of my friend's  RHEL system.
It has only two entries:

search                       localdomain

He says he has never configured any parameter to get RHEL running on the internet.
I happended automatically.
I guess these entries are standard entries that are with every RHEL pc.
If his computer can run without making any changes in the /etc/resolv.conf file then why should my Ubuntu pc need addition of a dnsaddress in /etc/resolv.conf?

2. I have seen that ubuntu does not have most of the important files that are with RHEL why so?

Accepted Solution

data_grrr earned 2000 total points
ID: 18026782
if the configuration is ok then you can connect to Internet
but there seems a problem and you should troubleshoot it...

first, check if it's a dns problem.

open the console, and type:


1- if it gets reply, then you connect to Internet but can't resolve domain names.
2- if it doesn't and times out then you might have a problem with the connection to your router.

if its the first situation then check this.. use console again..
type this:
nslookup www.google.com

this command will ask (public dns server i am using),
'what's the domain name of www.google.com
if it gets the answer, then you have a problem with your dns configuration (possibly in ubuntu)

if its the 2nd situation then try to ping your router (usually its
if it times out then we should check your configuration deeper..
your router conf. must be ok, cos you're using it with xp..
but if your router's running its dhcp service, and gives the same IP address to the XP
there might be an address conflict..

you can get to your router configuration page by typing the address to your browser
it will ask your username and password, if you doesnt give any password, it must be a default
like 'root' 'root' or 'admin' 'root'. plz read your router manual to learn the default username/password
and don't forget to change it, cos someone can hack your network easily after he gets to your router.

I'll wait.. plz feedback your troubleshooting..


Expert Comment

ID: 18026860
firewall question:

ubuntu doensn't have a firewall configuration but it comes with iptables..
and unless you use some services that listens to outside you're secure...and because of it has no configuration it does not harm anything. so you really dont need to shut it down i think.. isn't your public dns server.. it must be your router or 2nd computer's network card..
if its your 2nd computer's  network card, then it might be the reason of your problem...

192.168.x.x means its private not public..


Author Comment

ID: 18033633

Thaks for your suggestion. The internet has started working on the first computer.
It was a dns configuration problem.

ping was getting a reply

nslookup www.google.com gave me a reply. Showed me the domain name of google.

I went to System->Administration->Network Tools->Devices

There were 3 devices in the network interfaces

Network Device: Loopback Interface (L0)
IP                                   Netmask               Gateway              

Network Device: Ethernet Interface(eth0)
IP                                   Netmask               Gateway           

Network Device:Modem Interface(ppp0)
IP                                  Netmask                 Gateway          

I changed the configuration of the Network Device:Ethernet Interface(eth0) from to the ip address of the router
Configuration: Static IP Address
IP                                  Netmask                 Gateway          

Note: I have given a static ip address to eth0. When i configure the ip to be assigned to it dynamically through dns, mozilla stops showing web pages again.

Then i restarted mozilla, typed www.google.com and it showed me the page

Author Comment

ID: 18033721

1) Now my second problem is that the Mozilla computer i have just configured ComputerA running Ubuntu, is the primary computer on which the router is attached.

I have another computer, ComputerB running on Ubuntu too.
I have networked both computers ComputerB with ComputerA through a network cable.

However the ComputerB does not seem to be  recognizing the existance of ComputerA which i just configured and is running the internet through mozilla.

In windows this was not a problem, windows would automatically detect another windows machine and would start showing it and i would start running the internet on the other computer too. I just needed one modem to run both the computers.

To detect if ComputerB detects the modem i pinged the router from it.

Connect: Network is unreachable

Then i also tried,
nslookup www.google.com
Connection timed out, no servers could be reached.

I tried to go to the router configuration page by typing the address in mozilla browser.
It asked me the username and password.
I typed nav/nav into it but it showed wrong username/password
I also tried root/root and admin/root but it still showed wrong username/password.

2) When i go to System->Administration There are two network related menu options

System->Administration->Network Tools

The first menu option System->Administration->Networking is available only on ComputerB, which i need to network with the ComputerA that is running mozilla. This option is not available on ComputerA. I assume this is because i think ubuntu has somehow detected the presence of ComputerA.

However when i select this option System->Administration->Networking, It shows me that it is opening the Networking dialog box. I can see the Networking tab opened in the status bar for 3 minutes, after that it disappears without showing the networking dialog box. Is that a configuration problem?

3) I am facing the same problem in my friend's computer running RHEL 9, when i select mozilla, it shows the mozilla tab in the status bar for 3-4 minutes then exists without displaying mozilla. Is this a configuration problem too.

I am not able to give you a feedback promptly as i am in my office when i recieve your reply. I have to go home after office hours in the evening and try out your suggestions before i can give you a feedback. Sorry for the delay.

Expert Comment

ID: 18034429

i guess this is your network..

this is no problem when you windows, because winxp can use Internet Connection Sharing

can't you connect both of the PCs to the router?
Your router has only 1 port?

If it has only one, then you should setup Ubuntu 1 as a internet sharing server (NAT)
to do it check this link

If your router has two ports then don't do it, and connect your PCs directly to the router..

do you know the ip address of the router?
if it's, then you must not give that address to the Ubuntu 1 or 2

let me explain:
your router has two addresses


to connect to Internet successfuly
Ubuntu1 must send the packets to the address of your router, it's

this is called 'gateway', and you should configure the gateway of Ubuntu1 as
eth0 is the address of your network card of Ubuntu1, and it can be 'between'
so make it

to be able to resolve names you should also configure the dns of Ubuntu1 as at this scenario.. but if you give it another public dns server address, its ok too

to be able to connect Ubuntu2 to Ubuntu1 you should use a cross-over cable between them.
and then configure the Ubuntu2 like this...

eth0: (cos we used and 1.2)
gateway: (cos 1.2 is Ubuntu1 and it will serve as a gateway for Ubuntu2)
dns: or your public dns server...or if you use Ubuntu1 as a local cache dns server..

if its too complicated for you, you can buy a small switch..then you need to apply the configuration above to the PCs..
then connect all the nodes to the switch..
and without configuring Ubuntu1 as a NAT you can surf the Internet...

also find your router's username and password before someone else finds it...
call someone or read the manual or google it...


Expert Comment

ID: 18034457
i realized something wrong..

to do this cross-over thing

ubuntu1 must have two interfaces..


you will connect eth0 of Ubuntu 2 to the eth1 of Ubuntu1

then the conf. should look like this at ubuntu2

eth0: (cos we used and 1.2 and 1.3)
gateway: (cos 1.3 is Ubuntu1 and it will serve as a gateway for Ubuntu2)
dns: or your public dns server...or if you use Ubuntu1 as a local cache dns server..

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month6 days, 10 hours left to enroll

782 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