Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem connecting internet and networking 2 computers runninb Ubuntu

Posted on 2006-11-19
17
Medium Priority
?
456 Views
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.

0
Comment
Question by:aman_greval
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
17 Comments
 
LVL 1

Expert Comment

by:data_grrr
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.






0
 

Author Comment

by:aman_greval
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
correctly
0
 
LVL 1

Expert Comment

by:data_grrr
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..
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Expert Comment

by:data_grrr
ID: 18003319
the file that keeps your nameservers

/etc/resolv.conf

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
0
 
LVL 1

Expert Comment

by:data_grrr
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..

 http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/
0
 

Author Comment

by:aman_greval
ID: 18019820
Is the ip address 192.168.1.3 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
nameserver 192.168.1.3
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?
0
 

Author Comment

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

Author Comment

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

/etc/resolv.conf
search                       localdomain
nameserver               192.168.1.1

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?
0
 
LVL 1

Accepted Solution

by:
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:

ping 195.175.39.39

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 195.175.39.39

this command will ask 195.175.39.39 (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 192.168.1.1)
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 192.168.1.1 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..















0
 
LVL 1

Expert Comment

by:data_grrr
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..

192.168.1.3 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..





0
 

Author Comment

by:aman_greval
ID: 18033633
datagrr:

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

ping 195.175.39.39 was getting a reply

nslookup www.google.com 195.175.39.39 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
127.0.0.1                        255.0.0.0

Network Device: Ethernet Interface(eth0)
IP                                   Netmask               Gateway
192.168.1.3                     255.255.255.0

Network Device:Modem Interface(ppp0)
IP                                  Netmask                 Gateway
59.94.103.4                    255.255.255.255

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

Note: I have given a static ip address to eth0. 192.168.1.1. 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
0
 

Author Comment

by:aman_greval
ID: 18033721
datagrr:

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.

ping 195.175.39.39
Connect: Network is unreachable

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

I tried to go to the router configuration page by typing the address 192.168.1.1 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->Networking
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.
0
 
LVL 1

Expert Comment

by:data_grrr
ID: 18034429
|ROUTER|--------|Ubuntu1|-------|Ubuntu2|

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
http://ubuntuforums.org/showthread.php?t=91370

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 192.168.1.1, then you must not give that address to the Ubuntu 1 or 2

let me explain:
your router has two addresses

(Internet)---- 82.80.12.43|ROUTER|192.168.1.1---------192.168.1.2|UBUNTU1|


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

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

to be able to resolve names you should also configure the dns of Ubuntu1 as 192.168.1.1 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: 192.168.1.3 (cos we used 192.168.1.1 and 1.2)
mask:255.255.255.0
gateway: 192.168.1.2 (cos 1.2 is Ubuntu1 and it will serve as a gateway for Ubuntu2)
dns: 192.168.1.1 or your public dns server...or 192.168.1.2 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...



















0
 
LVL 1

Expert Comment

by:data_grrr
ID: 18034457
i realized something wrong..

to do this cross-over thing

ubuntu1 must have two interfaces..

eth0: 192.168.1.2
eth1: 192.168.1.3

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

then the conf. should look like this at ubuntu2

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

Featured Post

Google Certified Professional - Cloud Architect

This course (1 of 3) is designed to help students who are interested in Google Cloud Platform (GCP) to become familiar with the platform, navigate the console and learn its capabilities. It will also prepare students for the Google Cloud Architect certification exam.

Question has a verified solution.

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

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

704 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