I have a Rasp-Pi 4B and it works OK using DHCP for both eth0 and wlan0.
Wanting to install a LAMP system, I attempted to set up a static IP for the wi-fi. At address 100
Now.. I have managed to get my eth0 working again, but wi-fi will not connect, at least as a static. So far, I have not tried to back it out to DHCP again.
Following are some of my setup files:
ifconfig:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.200.62 netmask 255.255.255.0 broadcast 192.168.200.255
inet6 fe80::dea6:32ff:fe36:b41e prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:36:b4:1e txqueuelen 1000 (Ethernet)
RX packets 1002 bytes 245978 (240.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 684 bytes 106416 (103.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 8 bytes 312 (312.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 312 (312.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.200.100 netmask 255.255.255.0 broadcast 192.168.200.255
ether dc:a6:32:36:b4:1f txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
===== if route ====
192.168.200.0/24 dev eth0 proto kernel scope link src 192.168.200.62
192.168.200.0/24 dev wlan0 proto kernel scope link src 192.168.200.100 linkdown
Note the linkdown. This there even after a
systemctl restart networking.service or a reboot.
Yes,I have issued a sudo ip route del 192.168.200.0/24 dev wlan0 to no effect. After reboot, the route is once again as above.
--------etc network interfaces ------
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
allow hotplug eth0
auto wlan0
iface wlan0 inet static
address 192.168.200.100
netmask 255.255.255.0
network 192.168.200.0
broadcast 192.168.200.255
gateway 192.168.200.1
dns-nameservers 192.168.200.98 1.1.1.1
source-directory /etc/network/interfaces.d
(Note that interfaces.d is empty.)
---------dhcpcd.conf----------
### NOT YET! static ip_address=192.168.200.101
#
###interface wlan0
###static ip_address=192.168.200.100
####static routers=192.168.200.1
#####static domain_name_servers=1.1.1.1 8.8.8.8
As I said, I'd like to make the wlan0 have a staic address of ...200.100 but it remains dead (unless I revert it to DHCP).
More info required? Can provide!
Thanx!