LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   connect: network is unreachable (https://www.linuxquestions.org/questions/linux-networking-3/connect-network-is-unreachable-538955/)

xeebeeeeeee 03-20-2007 04:17 AM

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?

xeebeeeeeee 03-20-2007 04:27 AM

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.

jlliagre 03-20-2007 05:29 AM

What IP address is set by DHCP to your Ethernet interface ?

Post "ifconfig -a" output.

xeebeeeeeee 03-21-2007 04:40 AM

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?

tredegar 03-21-2007 12:56 PM

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

tpmadigan 03-21-2007 01:19 PM

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!

xeebeeeeeee 03-22-2007 04:03 AM

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


All times are GMT -5. The time now is 05:08 AM.