LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-20-2007, 04:17 AM   #1
xeebeeeeeee
LQ Newbie
 
Registered: May 2005
Posts: 22

Rep: Reputation: 15
connect: network is unreachable


Hello,

I want to connect to internet with Linux (Ubuntu one of the latest). Now I use windows without problem and I am always switching to find out the problem. I don't understand what's the matter. Why it works with windows and not Linux.

Explication :

There is a modem/bridge to connect directly to internet via DSL. DHCP is used to get IP. Linux get an IP but no internet. I ping my adress OK, but other adress "connect: network is unreachable". So I set the network with all information IP, gateway, dns (seen with windows) but same thing.

I look for to information about "connect: network unreachable" but nothing really clear and precise. I never had problem this problem with other modem/router from other ISP. I would like at least to point out the problem to understand.

Any idea? Explication why it doesn't work?
 
Old 03-20-2007, 04:27 AM   #2
xeebeeeeeee
LQ Newbie
 
Registered: May 2005
Posts: 22

Original Poster
Rep: Reputation: 15
I forget :

Under windows, I can access to the modem with a web browser http://10.1.1.1 . But under Linux it can't.
 
Old 03-20-2007, 05:29 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
What IP address is set by DHCP to your Ethernet interface ?

Post "ifconfig -a" output.
 
Old 03-21-2007, 04:40 AM   #4
xeebeeeeeee
LQ Newbie
 
Registered: May 2005
Posts: 22

Original Poster
Rep: Reputation: 15
ifconfig -a : (eht0 : cable, eth1 : wifi)

eth0 Lien encap:Ethernet HWaddr 00:C0:9F:EE:49:6D
inet adr:58.108.96.178 Bcast:58.108.96.255 Masque:255.255.255.0
adr inet6: fe80::2c0:9fff:feee:496d/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:35 erreurs:0 :0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:13174 (12.8 KiB) Octets transmis:1530 (1.4 KiB)
Interruption:169

eth1 Lien encap:Ethernet HWaddr 00:13:CE:59:83:31
UP BROADCAST MULTICAST MTU:1500 Metric:1
Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:0 (0.0 b) Octets transmis:0 (0.0 b)
Interruption:177 Adresse de base:0xe000 Mémoire:c820b000-c820bfff

lo Lien encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
Packets reçus:9 erreurs:0 :0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
Octets reçus:472 (472.0 b) Octets transmis:472 (472.0 b)

sit0 Lien encap:IPv6-dans-IPv4
NOARP MTU:1480 Metric:1
Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
Octets reçus:0 (0.0 b) Octets transmis:0 (0.0 b)



Why DHCP is used? DHCP is used with windows to get IP as soon as it is set automatically. Yes the modem is not really a bridge, nor a router. I would said between. Anyway, it is the modem that connects to the provider by pppO and send the login and password. The modem is also a DHCP server that gives the IP given by the provider.
Maybe I should change modem setting to get a real local network (with just one computer) but why does it works with windows and not linux?
I am a bit confused because the way it works is weird. The modem is just like a bridge in one way because I get an internet IP and in other way it is like a router because IP is set by the modem by DHCP. It would be more distinct if the modem was a real bridge or a router. By the way, I just check the modem and the mode used is optus bridge (there is also NAPT and full bridge). Maybe it is the mode that is bastard.

Am I clear enough? So why does it works with windows but not linux? what do you think?
 
Old 03-21-2007, 12:56 PM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
inet adr:58.108.96.178 Bcast:58.108.96.255 Masque:255.255.255.0
58.108.96.178 seems to belong in Sydney, Australia! Is your ISP in Australia?

OK, the connection problem is because your modem lives at 10.1.1.1

But your PC's address is (currently) 58.108.96.178, and the "Broadcast" is 58.108.96.255, so that's on a different network, and you cannot see the modem. (I have no idea how your PC got this address). Because your PC cannot see the modem, it cannot connect to the internet either.

Your PC needs an IP address like 10.1.1.3 and a Broadcast of 10.1.1.255 and a "Masque" of 255.255.255.0.

Fortunately, this should all be very easy to fix.
You have already set up your modem to connect to your ISP (so you have your passwords all OK). So no work to do there.

It is probably easiest to set up your PC with a static LAN address. Backup, then edit your /etc/network/interfaces file to look like this:
Code:
# This is the file /etc/network/interfaces

auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

auto eth0
iface eth0 inet static
address 10.1.1.3
netmask 255.255.255.0
gateway 10.1.1.1
You will need to be root to edit that file so do

cp /etc/network/interfaces /etc/network/interfaces.old
sudo your_favourite_editor /etc/network/interfaces


Make the edits, then save the file. Now restart the network like this:

sudo ifdown eth0
sudo ifup eth0


Now you should be able to look at your modem/router with http://10.1.1.1 and use the big bad internet. When you reboot, you will automatically be connected to the internet.

If you still have problems, please tell us the name / model number of your modem/router, or (better) give us a link to its user-documentation (usually on the manufacturer's website).

Edit:
Quote:
The modem is also a DHCP server that gives the IP given by the provider.
This is why it was not working for you, you need to set the modem so it gives an IP NOT supplied by your ISP's DHCP server, but supplied by the modem's DHCP server (which should serve up IP's on the 10.1.1.2 -10.1.1.254 range, but you can safely ignore this if you just set your PC up for a static IP.
I cannot help you with windows, but that seems to be working.
End of edit

Last edited by tredegar; 03-21-2007 at 01:03 PM.
 
Old 03-21-2007, 01:19 PM   #6
tpmadigan
LQ Newbie
 
Registered: Jul 2006
Location: Cheese steak capital of the world!
Distribution: RHEL4, RH9, SuSE 10.0
Posts: 8

Rep: Reputation: 0
Another item you want to check is that your Linux box is actually plugged into an available port on your DSL modem. A co-worker and I spent half of this morning chasing a "network unreachable" problem only to find that the Ethernet cable was not plugged into our LAN. Also, be sure that the networking cable you are using is a "straight through" cable and *not* a "cross-over" cable. Good luck!
 
Old 03-22-2007, 04:03 AM   #7
xeebeeeeeee
LQ Newbie
 
Registered: May 2005
Posts: 22

Original Poster
Rep: Reputation: 15
OK, I set an IP static like 10.1.1.3 and after reboot it works.

It was so simple, just needed to use more my head.

Thank you
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to connect to Internet. (Network is unreachable) georgiozoze Linux - Newbie 22 10-14-2006 05:51 AM
Network unreachable Icu2 Fedora 4 03-23-2006 03:25 AM
Getting message "connect: Network is unreachable" trying to access the Internet denver1980 Linux - Networking 5 12-29-2004 05:22 PM
connect: Network is unreachable teach42 Fedora 1 08-10-2004 06:16 PM
connect: Network is unreachable joenomad Linux - Networking 11 04-21-2002 10:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration