# Two networks on one NIC

## enkil

My setup is basically like this:

I have a cable-modem connected to a switch. I have two computers and a WLAN router connected to the switch. The computers and the WLAN router receive public IP addresses via DHCP from the cable-modem. I use the WLAN router for wireless clients like laptops and smartphones. The wireless clients use static IP addresses in 192.168.74.0/24

My problem is that I cannot reach the wireless clients or the WLAN router from the computers connected to the switch. My idea was that I could easily connect to the wireless clients by adding a second IP adress in the 192.168.74.0/24 network on the computers that are connected to the switch, so I did this:

```
ip address add 192.168.74.224/24 brd 192.168.74.255 dev eth0
```

I get this as a result:

```
ip address show

[...]

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000

    link/ether 00:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff

    inet XXX.XXX.XXX.XXX/20 brd 255.255.255.255 scope global eth0

    inet 192.168.74.224/24 brd 192.168.74.255 scope global eth0

ip route show

192.168.74.0/24 dev eth0  proto kernel  scope link  src 192.168.74.224 

XXX.XXX.XXX.XXX/20 dev eth0  proto kernel  scope link  src XXX.XXX.XXX.XXX  metric 2 

127.0.0.0/8 via 127.0.0.1 dev lo 

default via XXX.XXX.XXX.XXX dev eth0  metric 2

```

But when I try to ping the wireless clients or the WLAN router (192.168.74.1), all I get is a "destination host unreachable"

Am I missing something? Any idea why it doesn't work? It shouldn't be a physical problem?

----------

## Jaglover

Your WLAN router does NAT? How many public addresses you get from your ISP?

----------

## enkil

It does NAT for the wireless clients, yes. I get up to four IPs from my ISP. Everything directly connected to the switch gets a different IP from my ISP, that is not the problem. I just can't connect to the wireless clients from the wired ones  that are connected to my switch.

----------

## Jaglover

Well, if it does NAT then you have to do port forwarding in your WLAN router. Is there a good reason your two PCs must have public addresses? Everything would be substantially easier if you had them on the same private subnet.

----------

