# My network is unreachable

## tinman

I'm trying to get a home network set up and can't seem to get it going.  Right now I have a jetdirect prinserver connected to a hub for testing. I got the IP address for the jetdirect and put it into /etc/hosts. When I try to ping it I get network unreachable. I start eth0 and don't get any errors and lspci detect my nic. Anyone know what might be the problem?

----------

## pjp

Can you post the contents of your /etc/conf.d/net file?

----------

## Lajasha

also what is the output of ifconfig and what is the ip of your print server. Are all of these DHCP?

----------

## tinman

Here is my /etc/conf.d/net file:

```
# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

#iface_eth0="dhcp"

#dhcpcd_eth0="..."

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="eth0/192.168.0.1"
```

Here is the output of ifconfig:

```
[oz 3] tinman > ifconfig

eth0      Link encap:Ethernet  HWaddr 01:01:01:01:01:01

          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:10 Base address:0xe800

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:3698 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3698 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:2725293 (2.5 Mb)  TX bytes:2725293 (2.5 Mb)

 

ppp0      Link encap:Point-to-Point Protocol

          inet addr:4.226.231.65  P-t-P:63.215.28.83  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1524  Metric:1

          RX packets:1255 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1118 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:3

          RX bytes:1352371 (1.2 Mb)  TX bytes:157994 (154.2 Kb)
```

The IP of my printserver is 192.0.0.192. I don't have DHCP set up.

----------

## Lajasha

If these are on the same network then the problem is that you have the pc and the print server logicly on different networks

192.0.0.192 and 192.168.0.2

change the print server to 192.168.0.x and you shold be fine or change the ip of your linux box, the ip your print server is using though is not a normal private range so you may wanna just change the print server.

----------

## nobspangle

also, your net script says your IP address is going to be 192.168.0.2 where as your ifconfig output says it is 192.168.0.1

----------

## K-Dawg

Yeah you have got some IP addressing isues.  First off in your /etc/conf.d/net file it clearly states that the default gw is 192.168.0.1 (which is your router I bet) and when you list the output of ifconfig your ip address is listed as this 192.168.0.1.  Try setting your ip address on that box to something between 192.168.0.2 and 192.168.0.254.  Do this manually by issuing a:

ifconfig eth0 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0 up and that should get your NIC set up properly then try pinging around your LAN again.

----------

## tinman

Well, I got those IP issues fixed, but I'm still getting the network unreachable error.  I do need to change the IP address on the print server, but I have to do it by connecting through the network. I can use telnet or its built in web server if I can get to it. HP suggested using the command route add 192.0.0.192 192.168.0.1, but when I do I get an error that says SIOCADDRT: No such device. I've tried this using Webmin, but that doesn't work either. I had this set up working with Mandrake, but it did all of the set up for me. 

One other thing. I changed the nic, but got the same results.

----------

## Lajasha

ok lemme make sure I have this straight.

PrintServer:

  IP: 192.0.0.192 subnetmask? probly 255.255.255.0

PC:

  IP: 192.168.0.1 subnetmask 255.255.255.0

If that is the case then you could change your pc's ip to 192.0.0.xxx and then restart the connection. At that point you should be able to connect to the print server then do what you need to do so you can change its ip. Then change the pc back.

The PC changes are done in /etc/conf.d/net

iface_eth0="192.0.0.191 broadcast 192.168.0.255 netmask 255.255.255.0"

----------

## tinman

OK. It's fixed. Thanks to everyone for their suggestions. I followed maletek's suggestion and it worked. I can now print to my Laserjet through the network. Now I'm planning to connect my kids two windoz computers.

----------

