# Network between three machines connected via switch

## pratty70

I have three machines connected raw via a switch. No router. No server. 

Should it be as simple as static IP addresses via

```

ifconfig eth0 192.168.1.21 up

```

And subsequently other machines .22 .23?

Both machines report correct address when running ifconfig after the above call on themselves. 

When I do this I get destination host unreachable when doing a ping with raw ip address. 

As there's no server or router involved I can't define a gateway?

Any obvious thoughts?

----------

## massimo

What does netstat -rn return? Please add a netmask (e.g., 255.255.255.0) to the ifconfig command.

----------

## pratty70

 *massimo wrote:*   

> What does netstat -rn return? Please add a netmask (e.g., 255.255.255.0) to the ifconfig command.

 

Apologies I did actually enter:

```

ifconfig eth0 192.168.1.22 netmask 255.255.255.0 up

```

netstat -rn returns

```

Kernel IP Routing table

Destination     Gateway    Genmask        Flags     MSS Window     irtt     Iface

192.168.1.0     0.0.0.0    255.255.255.0  U           0  0            0      eth0

127.0.0.0       0.0.0.0    255.0.0.0      U           0  0            0      lo

```

----------

## massimo

What kind of switch (managed?) is used for this setup? I assume netstat -rn returns for all boxes the same information.

----------

## pratty70

 *massimo wrote:*   

> What kind of switch (managed?) is used for this setup? I assume netstat -rn returns for all boxes the same information.

 

It's just a standard Netgear FS605 unmanaged switch.

Yes, netstat -rn returns the same for all boxes.

----------

## massimo

This somehow does not look right:

```
127.0.0.0       0.0.0.0    255.0.0.0      U           0  0            0      lo 
```

Did you add this route?

----------

## pratty70

Hmmm. Not that I'm aware of. 

I need to check back through some config files. This system is an embedded system that hasn't changed for a number of years and used to work in a client server environment with dhcp. I will post some more info later when I get chance to look at the files again. 

Thanks for the input.

----------

