1

I have Motion running on my Pi.

I want to be able to access the Motion interface/feed (hosted on <pi ip>:8081) to be accessible both via WiFi and via Ethernet with a static address and DHCP for both the interfaces. I would also prefer to keep them isolated from each other/not have them bridged.

Have configured wlan0 to act as a wireless access point (as give in this guide, but without the Routing/Masquerade).

This worked as expected.

After this I tried doing the same for Ethernet, so I also added a static address for eth0 to /etc/dhcpcd.conf and added entry to enable dnsmasq for eth0 (via a file in etc/dnsmasq.d/).

The static address for eth0 is different from wlan0 and so are the dhcp-range.

I can only access via one of the interfaces at a time. So if I boot up the Pi connected with the Ethernet, I can access Motion on the Pi (via Ethernet). However, access via WLAN fails. On the other hand, with Ethernet unplugged I can access Motion via WLAN.


How do I enable both the Eth and Wlan to work independently with DHCP and static IP on both of them to access Motion on the Pi?

Also, is it possible to have the same static IP address for both the interfaces?


Edit: Output of various commands as asked by @eftshift0:

$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:c3:d7:6b brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:96:82:3e brd ff:ff:ff:ff:ff:ff


$ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:c3:d7:6b brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::f98e:1b2a:d923:6474/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:96:82:3e brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.2/24 brd 192.168.0.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::496:128:e7ec:f5b0/64 scope link 
       valid_lft forever preferred_lft forever


$ netstat -lntp | grep 8081
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN      -       
Kanchu
  • 115
  • 6

1 Answers1

1

The problem that you are having is that Linux does not like having multiple interfaces on the same subnet. (Another question regarding this.) In its routing table, it will choose one of the interfaces as the "best" route to your local network, so all the other interfaces will end up not seeing any traffic. It is possible to get this configuration to work, but you'll need to set up ARP rules and policy-based routing tables.

I do have to wonder if you need this complicated of a setup though: without bridging, traffic from the two interfaces would never see each other anyways. If you're using the wireless interface as an AP that is completely separated from the wired network, it shouldn't be using the same network address (give it something like 192.168.1.1/24.) That would take care of the issue.

ErikF
  • 166
  • 3