The wireless component of my router started suddenly flaking and dropping connections, so I improvised a WAP from an old netbook, wired to this router. I'm very ignorant about networking so I'm sure there's a misunderstanding on my part, but while devices on the WAP can reach the whole network, I can't figure out how to reach them from the wired devices. The LAN looks something like this:
--------------------
| ROUTER |
| 192.168.1.1 |
--------------------
| | | | |
Modem A B C |
|
-----------------
| D (WAP) |
| 192.168.1.22 |
| 192.168.45.1 |
-----------------
_ _ _
= = =
E F G
Devices A, B and C are in the 192.168.1.x IP range. Wireless devices E, F and G are on 192.168.45.x.
So if I ping A from E, I get a response. According to wireshark, though, the ping originates from 192.168.1.22. E is unreachable when pinged from A on its .45.x address.
/etc/udhcpd.conf:
start 192.168.45.2
end 192.168.45.18
interface wlan0
remaining yes
opt dns 192.168.1.1 8.8.8.8
opt subnet 255.255.255.0
opt router 192.168.45.1
opt lease 864000
/etc/hostapd/hostapd.conf:
interface=wlan0
ssid=MYWAP
hw_mode=g
channel=6
auth_algs=1
wmm_enabled=0
wpa=2
wpa_passphrase=mypassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
/etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.22
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
iface wlan0 inet static
address 192.168.45.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.nat
IP forwarding script goes like this:
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
echo 'net.ipv4.ip_forward=1' > /etc/sysctl.conf
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
sh -c "iptables-save > /etc/iptables.ipv4.nat"
I've tried setting up a static route on the modem-connected router, with no success:
Destination LAN IP: 192.168.45.0
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.22
Interface: LAN & Wireless
Is there any way to easily normalize network discovery so that wireless printers, etc, connected to the WAP can be used by the wired devices? Am I going about this wrong? Can I somehow put them all on the same subnet and leave the DHCP functionality to the original router?