I'm trying to configure my RPi to give me access to devices conencted either of eth0 or wlan1.
Desired function is this:
- User connects to RPi AP via wlan1 and is given an IP
- Separate device connects to RPi via eth0 and is given an IP
- User can access configuration interface of eth0 connected device via local IP address
So far I have managed to get my eth0 and wlan1 adapters configured to give IPs on two different subnets with the below dnsmasq and dhcpcd configurations;
# dnsmasq.conf
interface=wlan1
dhcp-range=wlan1,192.168.4.2,192.168.4.99,24h
interface=eth0
dhcp-range=eth0,192.168.5.1,192.168.5.99,24h
listen-address=::1,127.0.0.1,192.168.5.1,192.168.4.1
# dhcpcd.conf
#wlan1 IP configuration
interface wlan1
static ip_address=192.168.4.1/24
nohook wpa_supplicant
#eth0 configuration
interface eth0
static ip_address=192.168.5.1/24
nohook wpa_supplicant
However, I cannot access the eth0 connected device when I am connected via wifi, presumably because it is on a different subnet. I have attempted to configure dnsmasq to have eth0 and wlan1 on the same subnet, but seems eth0 is not assigned an IP when I try this:
# dnsmasq.conf
interface=wlan1
dhcp-range=wlan1,192.168.4.2,192.168.4.100,24h
interface=eth0
dhcp-range=eth0,192.168.4.102,192.168.4.200,24h
listen-address=::1,127.0.0.1,192.168.4.1,192.168.4.101
# dhcpcd.conf
#wlan1 IP configuration
interface wlan1
static ip_address=192.168.4.1/24
nohook wpa_supplicant
#eth0 configuration
interface eth0
static ip_address=192.168.4.101/24
nohook wpa_supplicant
How do I achieve what I want to do?
ip route
.ip route
?