# [Solved] Network not reachable

## Taldor

I just finished intalling my wireless network PCI-card (Sitecom WL-121) using ndiswrapper. The problem is that when emerge tries to download a file, it fails and when I ping a random IP adress or I get the message that the network is not reachable. When I use iwconfig, I see that is configured correctly and it automaticly connected to the correct access point, which has internet access. Now my problem is I don't have a clue how to let it connect to the internet.

Edit: Is there a conveniant way to copy the output from a command like iwconfig to a file? (So I can copy it here.)Last edited by Taldor on Sun Jun 18, 2006 10:09 am; edited 5 times in total

----------

## tuber

Can you ping the access point?

----------

## Taldor

The only IP I can ping is 127.0.0.1. All other IPs (including the access point) I tested gave 'Network not reachable'.

Note: At the installation I skipped the entire section about networking. Maybe I skipped a bit to much...

Something else i forgot: When I type "# ndiswrapper -l", the computer gives no output, nor a new '#'. So i have to reset it.Last edited by Taldor on Wed Jan 26, 2005 1:37 pm; edited 1 time in total

----------

## joeswift

check out the following links, may help:

http://gentoo-wiki.com/HOWTO_Building_a_Wireless_Access_Point_With_Gentoo

http://gentoo-wiki.com/HOWTO_Wireless_Configuration_and_Startup

----------

## Taldor

I tried the howto's where they apply, but no success so far. I'm still getting the message "Network not reachable".

----------

## ak7

Network not reachable usually indicates a routing problem.

Did you add a default route?

```
route add ethX default gw [gateway name or ip] 
```

----------

## Taldor

```
route add wlan0 default gw [gateway name or ip] 
```

Anything I fill in as gateway, gives "Host name lookup failure".

My /etc/hosts:

```
127.0.0.1   localhost

                                         # 61145411 is the network

192.168.1.1   AP.61145411       AP       # Access point

192.168.1.5   Taldor.61145411   Taldor   # Me

# IPV6 versions of localhost and co

::1    ip6-localhost   ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts
```

----------

## alimutlu

what is the output of

ip route list

and

ifconfig -a

does youe wlan0 has a vail ip address ?

----------

## James Wells

 *Taldor wrote:*   

> 
> 
> ```
> route add wlan0 default gw [gateway name or ip] 
> ```
> ...

 

   I could be mistaken, but I believe the correct syntax for this is;

      route add default gw [gateway name or ip] device wlan0

   However, I suspect that this is not the issue.   Right off the bat, I am guessing that you simply don't have an IP address assigned to the wlan0 device.

----------

## Taldor

 *alimutlu wrote:*   

> ip route list

 

This gives "ip: command not found". How can I install it? "emerge ip" did not work.

 *Quote:*   

> 
> 
> ifconfig -a
> 
> 

 

This gives:

 *Quote:*   

> eth0 .....
> 
> lo .....
> 
> wlan0 Link encap: Ethernet HWaddr: 00:0C:F6:AA:00:03
> ...

 

 *Quote:*   

> does youe wlan0 has a vail ip address ?

 

I don't know, so most likely not. How can I assign one? And which ip should I assign to it?

 *James Wells wrote:*   

> route add default gw [gateway name or ip] device wlan0

 

I checked it, it is "route add default gw [gateway name or ip] dev wlan0", if that matters.

----------

## James Wells

[quote="Taldor"][quote]

ifconfig -a

This gives:

 *Quote:*   

> wlan0 Link encap: Ethernet HWaddr: 00:0C:F6:AA:00:03
> 
> BROADCAST MULTICAST MTU:1500
> 
> Metric:1
> ...

 

   Type the following;

```
ifconfig wlan0 192.168.1.5 netmask 255.255.255.0
```

   This will manually assign the IP address of 192.168.1.5 to your wlan0 device.  At this point, you should be capable of pinging your wireless access point.  To test this, you will want to use the following;

```
ping -c 3 192.168.1.1
```

   This will return something like the following;

```

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.

64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=6.54 ms

64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.86 ms

64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.83 ms

--- 192.168.1.1 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2002ms

rtt min/avg/max/mdev = 1.835/3.416/6.549/2.215 ms

```

   This indicates that you are properly talking to the access point.  Unfortunately, we do not know enough about your network to really take you beyond this point.

----------

## Taldor

 *James Wells wrote:*   

> 
> 
> ```
> ifconfig wlan0 192.168.1.5 netmask 255.255.255.0
> ```
> ...

 

That did it! Now I can finally ping to the access point. Thanks! 

I still get 'network not reachable' when i try to ping somone outside our network.

 *Quote:*   

> This indicates that you are properly talking to the access point.  Unfortunately, we do not know enough about your network to really take you beyond this point.

 

The access point is connected to the internet with an ADSL connection and runs WinXP. Do you need some more information?

----------

## James Wells

 *Taldor wrote:*   

> The access point is connected to the internet with an ADSL connection and runs WinXP. Do you need some more information?

 

   Okay, you will need to enable network sharing in WinXP, unfortunately, I don't know windows well enough to figure out to do this without sitting down at it.

   Once you have the network sharing enabled, you will need to up an IP address on the WinXP server, which you will use as your internal gateway address.  Once you have that address, you simply add it as your default route.  Please note, that unless your wireless access point is your router, then your default gateway is not your wireless access point.

----------

## Taldor

When I go to 192.168.1.1 (under Windows), I see "IP Adress: 217.152.36.37 - IP Gateway: 217.152.36.1". 

I added both to my route-table:

```
Destination   Gateway Genmask         Flags Iface

-------------------------------------------------

217.152.36.1  *       255.255.255.255 UH    wlan0

217.152.36.37 *       255.255.255.255 UH    wlan0

192.168.1.0   *       255.255.255.0   U     wlan0

... (other interfaces)

```

When i try to ping 217.152.36.1/37, it both doesn't respond.

----------

## cazze

hi,

i've been following this thread and i see you getting further every day   :Razz: 

Is it possible for you to let your accesspoint act as a dhcp server, then it would be very easy to put in an ip address for your wireless clients with a valid gateway address. (gateway address=internal ip address windows xp box).

kammicazze

----------

## Taldor

 *kammicazze wrote:*   

> Is it possible for you to let your accesspoint act as a dhcp server, then it would be very easy to put in an ip address for your wireless clients with a valid gateway address. (gateway address=internal ip address windows xp box).

 

I believe it already acts as dhcp server:

 *Quote:*   

> Router IP Address: 192.168.1.1
> 
> Subnet Mask: 255.255.255.0
> 
> DHCP Start Address: 192.168.1.2
> ...

 

So I should type "route add 192.168.1.1 dev wlan0"?

I have to retype "ifconfig wlan0 192.168.1.5 netmask 255.255.255.0" every time I reboot, (how) can I make my computer remerber this?

----------

## cazze

Ok, your dhcp server seems ok. The problem is you (your pc) doesn't act as a dhcp client. If it acts as a dhcp client, you don't have to manualy put those route commands and ifconfig command.

 *Quote:*   

> I have to retype "ifconfig wlan0 192.168.1.5 netmask 255.255.255.0" every time I reboot, (how) can I make my computer remerber this?

 

This is depending on your baselayout how you have to configure this.

What is the version of your baselayout?

Do you have a /etc/init.d/net.wlan0 file and if so, what is the output of ls -l /etc/init.d/net.wlan0?

kammicazze

----------

## alimutlu

when you type

dhcpcd wlan0 

you must lease an ip address from the the dhcp server,

or you can configure your wlan0 with network-admin

----------

## Taldor

I found it! First I typed "ifconfig wlan0 192.168.1.5 netmask 255.255.255.0", then "route add default gw 192.168.1.1". Right now I'm installing firefox, so I can't check /etc/init.d/net.wlan0. I'll do so when the installing has finished.

----------

## cazze

lol, you can't check it?  :Smile: 

are you working under X? why don't you open another console to look at it?

You know, linux is multitasking too   :Twisted Evil: 

----------

## Taldor

 *kammicazze wrote:*   

> are you working under X?

 

No.  :Razz:  I don't know how to go to another command line when I'm not in X. And now I'm using another computer.  :Razz: 

----------

## cazze

not working under X and emerging firefox  :Smile: 

well, to go to another console, just do alt-F2, alt-F3 etc.

kammicazze

----------

## Taldor

 *kammicazze wrote:*   

> Do you have a /etc/init.d/net.wlan0 file and if so, what is the output of ls -l /etc/init.d/net.wlan0?

 

That file does not exist.

----------

## cazze

Ok, well you will have to create that file, but depending on your baselayout, it will be a symbolic link to net.lo or net.eth0.

----------

## Taldor

 *kammicazze wrote:*   

> ... but depending on your baselayout,....

 

What is a baselayout? And how do I check it?

----------

## cazze

You can do a emerge -pv baselayout, it should give you the version installed

----------

## Taldor

I never saw your response...anyway, this is the output I get:

```
[ebuild   R   ] sys-apps/baselayout-1.9.4-r6  -bootstrap -build -debug -livecd (-selinux) -static (-uclibc) 0 kB
```

After I recompiled my kernel a while ago and used the gnome network tool, I get a few warnings like these at boot for both eth0 and the wlan0 card:

 *Quote:*   

> *Bringing eth0 up...... 
> 
> SIOSIFADDR: No such device
> 
> eth0: unknown interface: No such device
> ...

 

When I enter 

```
#modprobe ndiswrapper
```

both my eth0 and wlan0 cards run fine, but I got to re-type it every time I reboot.

Note: my eth0 card isn't supposed to do anything.

EDIT: It's fixed now, I don't know how I did it tough.

----------

