0

So I have this old Raspberry 3A lying around, which isn't equipped with internal wlan. I try to use it as a chicken surveillance cam, therefore I need a working wlan connection as I can't run network cables to the chicken coop. I bought an Edimax USB dongle which uses the rtl8188usb chip and configured my setup via dhcpd.conf:

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers


# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
interface eth0
static ip_address=192.168.1.14/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.2 192.168.1.1 8.8.8.8


interface wlan0
static ip_address=192.168.1.141/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.2 192.168.1.1 8.8.8.8

ip a:

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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.14/24 brd 192.168.1.255 scope global dynamic eth0
       valid_lft 7160sec preferred_lft 5685sec
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 08:be:ac:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.208/24 brd 192.168.1.255 scope global dynamic noprefixroute wlan0
       valid_lft 6280sec preferred_lft 4906sec

ip r:

default via 192.168.1.1 dev eth0 proto dhcp src 192.168.1.14 metric 202 
default via 192.168.1.1 dev wlan0 proto dhcp src 192.168.1.208 metric 303 
192.168.1.0/24 dev eth0 proto dhcp scope link src 192.168.1.14 metric 202 
192.168.1.0/24 dev wlan0 proto dhcp scope link src 192.168.1.208 metric 303 

But, while the static IP for eth0 is working, my wlan0 still gets assigned a random IP from my dhcp-server.

To clarify: I want a statip IP 192.168.1.141 on my wlan0 and at the same time a static IP 192.168.1.14 on eth0.

11
  • What do ip a & ip r show? – Milliways May 8 '20 at 6:46
  • added into question – bstabens May 8 '20 at 6:53
  • You could try sudo dhclient -v wlan0 and check /var/lib/dhcp/dhclient.leases I assume /etc/network/interfaces is empty. – Milliways May 8 '20 at 7:14
  • /etc/network/interfaces is at default state. The dhclient.leases shows me the successful lease, but the goal is to have the static ip on wlan0, and not a lease. – bstabens May 8 '20 at 7:28
  • Also check 141 is not being used! – user115418 May 8 '20 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.