Raspberry Wifi looses connection when lan cable unplugged - raspberry-pi

Using latest Buster release, I can set up my wifi and lan and it works fine. However, if I remove the lan cable, then there is no connectivity through the wifi. The Pi cannot even be pinged. I am using a dhcpcd.conf file that is the same as another Raspberry that works when the lan cable is unplugged. What am I missing?
This is the dhcpcd.conf file
# 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
option classless_static_routes
# 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
interface eth0
static ip_address=192.168.0.22/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.18 8.8.8.8
static domain_search=
interface wlan0
inform 192.168.0.23
static routers=192.168.0.1
static domain_name_servers=192.168.0.18 8.8.8.8

I found a way to make this work but I don't understand why I had to do this. I changed the metric value for each and made the wifi a higher priority, (a lower number). That seems to make it work.

Related

No internet through GSM connection, possible interface issue

I have a problem with getting GSM connection to work.
Currently used:
Advantech UNO-2272G device
Ubuntu 18.04
NetworkManager/nmcli package
The card works when put in a mobile phone.
*Note: following screenshots are made over SSH and remotely, as the device is currently plugged in ethernet until this issue is resolved.
This is current state of "nmcli" command:
nmcli print
The system connection for GSM is called "radi". My guess is that somehow the interface of that connection is trying to work with the other interface (underlined in red), which in turn is trying to get its DNS conf from router (to which it currently is connected with ethernet, but nothing changes if device is plugged out from router and NetworkManager and network is restarted, it still tries to get to router for its DNS).
This is current state of "ip addr" command:
ip addr
This is current state of /etc/network/interfaces file:
interfaces
This is current state of /etc/NetworkManager/system-connections/radi file:
systemconnection
So, the question is, what am I missing here? Is it the interface issue as written above, or something else entirely?
Disclaimer: I am not that proficient in the stuff presented here, most if not all of it was configured following guidelines on the internet.
Hey I'm not expert in this but I do have a different cellular modem connected to a linux system (RPI) and working with NetworkManager (and ModemManager). My modem was connected by a serial UART port (ttyACM0) so that seems similar to what you have done.
When I configured my cellular connection profile in NM I had to setup the ppp section of the connection profile on top of the gsm part. I also went into my ppp options (on the host) and configured those to match a chat script that came from my modem manufacturer. WHen NetworkManager runs a ppp interface it expects the ppp options for the pppd (daemon) to be configured properly.
Here is the ppp section of my NetworkManager cellular connection settings file. Most are defaults and in my case I only added the baud rate for my modem (since it was connected to a UART).
ppp.noauth: yes
ppp.refuse-eap: no
ppp.refuse-pap: no
ppp.refuse-chap: no
ppp.refuse-mschap: no
ppp.refuse-mschapv2: no
ppp.nobsdcomp: no
ppp.nodeflate: no
ppp.no-vj-comp: no
ppp.require-mppe: no
ppp.require-mppe-128: no
ppp.mppe-stateful: no
ppp.crtscts: no
ppp.baud: 115200
ppp.mru: 0
ppp.mtu: auto
ppp.lcp-echo-failure: 0
ppp.lcp-echo-interval: 0
If this is not helpful then have a look at this thread on NM and routing. In their case eth0 was a local network interface and eth1 was their cellular interface
Now to save you 10 hours of troubleshooting - note that the route
metric is independent of the DNS priority! So if you still have
connectivity issues, make sure it's not a DNS resolution issue (eg.
your DHCP server is providing a dummy resolution service). If it is,
then increase the ipv4.dns-priority of your eth0 connection to make it
lower priority, and/or make sure the ipv4.dns-search of your eth1 is
set to "~" to make it the go-to option.

stm32 lwip - unable to respond to ping

I am trying to configure the minimum I can to get my Nucleo-F429ZI to respond to a ping
Using CubeMX, I enable ethernet in MII mode and assign a unique MAC address.
In Middleware I enable LwIP (no RTOS, no DHCP) I set an IP of 192.168.1.55, 255.255.255.0, 192.168.1.1.
I enable ICMP, UDP and TCP.
I build in TrueStudio and run, but no response to a ping from my linux box on the same network.
In main.c I see
MX_LWIP_Init(); which call lwip_init() with the address mask and gw I configured.
In lwip.c
I see my IP, mask and gw initialized correctly followed by lwip_init();
I try to ping from my linux box (same network) but get "host not found"
What am I missing???
in Nucleo-F429ZI the Ethernet physical chips is LAN8742A-CZ-TR that you should configure Ethernet media (your micro mac) in RMII mode, FOR MII interface you need RXD[3:0] and TXD[3:0] between your media level and physical level , but if you look at LAN8742A-CZ-TR datasheet or Nucleo-F429ZI schematic you found that between your physical and media you just have RXD[1:0] and TXD[1:0] pins that is RMII standard interface
your problem can occur according several reasons,
check your media config
check connection and look at links led on your eth connector
check auto negotiation process between your Linux box and phy
CubeMX default RMII pinout and Nucleo-F429ZI pinouts are different. You must change the following pins for achieving communication via ethernet.
PB11 -> PG11 (RMII_TX_EN)
PB12 -> PG13 (RMII_TX_D1)
Also, PHY address is should set to 0 in ETH settings.

Problems setting up HostAPD on Pi 3 Jessie Lite

I'm following this Adafruit tutorial with the end goal of setting up a portable Tor routed WiFi access point. I did this entire tutorial start to finish yesterday on the same Pi 3 running Raspbian Jessie, and it worked perfectly.
However, due to SD card size restrictions (I'm on a tight budget and I need to make quite a few) and the fact that I don't want a GUI, I decided to start again but with Raspbian Jessie Lite (using the last Jessie release before Stretch), and now I can't seem to get past the HostAPD setup when I'm following the tutorial line for line and using the same Pi 3!
THE PROBLEM:
When I get to the "First Test" part of the tutorial and run HostAPD for the first time I should get an output something like this:
But instead I get this:
user0#raspberrypi:~ $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:41:64:5e and ssid "Extrea-Special-Wifi"
wlan0: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED
The tutorial (and multiple other sources) says that if I'm using the built-in Wi-Fi module, I don't need to specify a driver for it (It worked yesterday without a driver specified too) but something is not working this time and the only thing I've changed is the OS from Jessie to Jessie Lite.
My laptop and other devices can see and connect to the network but there is no internet. Of course I can ping the Gateway IP but not the DNS 8.8.8.8.
My HostAPD config file is the same as the tutorial's and is as follows:
interface=wlan0
#driver=rtl871xdrv
ssid=Extrea-Special-Wifi
country_code=GB
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Password123
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_group_rekey=86400
ieee80211n=1
wme_enabled=1
note: Password123 is not a password that I use and it will be changed!
My /etc/network/interface file is not quite the same as the tutorial but worked yesterday like this:
# interfaces(5) file used by ifup(8) and ifdown(8)
# 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:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.42.1
netmask 255.255.255.0
I realise that the this file says:
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
But it worked fine on the full version of Jessie (Latest release too)
and if this is the cause of the problem I'm really not sure how to make this tutorial work with the /etc/dhcpd.conf file.
My /etc/sysctl.conf is set up as follows:
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#
#kernel.domainname = example.com
# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3
##############################################################3
# Functions previously found in netbase
#
# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1
# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1
# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1
###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
net.ipv4.ip_forward=1
The bottom of this file seems to be missing 2 lines that are visible in the screenshot from the tutorial however I didn't add them yesterday because the tutorial doesn't even mention them (as I said, yesterday I managed to get the Pi working perfectly as a Tor Routed access point using exactly the same steps).
Screenshot from the tutorial:

Raspberry Pi Zero W Honeypot (similar to Wireless AP)

I want to access a server on the Raspberry Pi Zero via WiFi.
YouTube Video describing the Problem
I am following the tutorial on this Blog for the Raspberry Pi .
Accessing the server with another laptop doesn't work. It says that it is not connected.
When I run on the Raspi
sudo cat /var/log/dnsmasq.log
I get at the end this error:
May 9 09:59:28 dnsmasq-dhcp[513]: no address range available for DHCP request via wlan0
But I am not sure if this has to do anything with the problem at all.
How can I make the Raspi Zero W http-Server (the http server is a server on the raspi) connectable over WiFi?
Here are the relevant parts of the files.
File: /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet static
address 10.0.0.1
netmask 255.255.255.0
broadcast 255.0.0.0
pre-up iptables-restore < /etc/iptables.rules
File: /etc/dnsmasq.conf
#...
#at the end of the file
log-facility=/var/log/dnsmasq.log
address=/#/10.0.0.1
interface=wlan0
dhcp-range=10.0.0.10,10.0.0.250,12h
no-resolv
log-queries
File: /etc/dhcp/dhclient.conf
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
File: /etc/dhcpcd.conf
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# 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
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
I have read the blog and i successfully implemented the server following all the steps.It is possible that you have misconfigured something. My bets are on the /etc/network/interfaces file or on the /etc/dnsmasq.conf.
Also, check if you don't have another dhcp server on. Maybe the internal /etc/dhcp/dhcpd.conf is overwritting your ip pool.
Post the relevant part of all those files to see if there is any error.
Simple solution, plug in a HDMI monitor and keyboard and use the desktop network GUI to set up the Wifi (click on the WiFi logo, top right).
A longer winded option would be to use one of the hundreds of how to articles out there, for Raspberry Pis (regardless of Pi zero to Pi3 they are the same).
A quick Google search found this: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-occidentalis
Or even (for those with shorter attention spans): https://www.google.co.uk/search?q=raspberry+pi+configure+wifi&oq=raspberry+pi+configure+wifi&aqs=chrome..69i57j0l5.6863j0j7&sourceid=chrome&ie=UTF-8#q=raspberry+pi+configure+wifi&tbm=vid
Good luck and don't be afraid to Google for these things.
If you run ifconfig -a, does your wlan0 interface have the proper IP address, 10.0.0.1? Mine did not. In /etc/network/interfaces I added the line
allow-hotplug wlan0
above the iface wlan0 line. That seemed to fix the address problem and the same error, "no address range available for DHCP request via wlan0" you are getting.
You have a problem with web pages then as nginx looks for pages in /var/www/html.
Use this line ...
sudo echo "<h1>hello<h1>" > /var/www/html/index.html
Note removal of "!" and different destination folder
I had the exact same problems you had and this got mine working for the most part.

configure ip for bitnami owncloud virtual appliance

I installed Bitnami owncloud virtual appliance stack on Virtual box and within no time, I was able to sync files to and from this box. However, the main problem with Virtual Box is that the IP address keeps changing when the owncloud instance is powered off and then turned back on - which makes sense. Is there any way to keep the server IP static so that we don't need to configure the clients everytime the IP is changed.
You could change the config (from auto to static) in the following way
sudo vi /etc/network/interfaces (“vi” or “nano”)
iface eth0 inet static
address 192.168.0.100
# your own IP
netmask 255.255.255.0
# network mask
gateway 192.168.0.1
# standard gateway (router)
dns-nameservers 192.168.0.1 8.8.8.8
# DNS (optional)
/etc/init.d/networking restart (restart network)
ifconfig
for the IP addresses check or you “shutdown –h now” (reboot)). Please, keep in mind that multiple copies need multiple IP's. In Virtual Box remember to switch between NAT and Bridge - if required.