Re: Dhcpd server usage with USB RDNIS interface that goes up and down

2021-08-19 Thread Tim via users
On Fri, 2021-08-20 at 05:26 +0100, Terry Barnaby wrote:
> Does anyone know of a configuration option to get the dhcp server to 
> listen on all network interfaces in a general way or to retry its 
> network connection when the interface goes down and up ?

As far as I've seen, if you don't specify an interface to listen to,
it's going to listen everywhere.  But the chances are that it only
listens to interfaces that are already up when it starts.  That seems
to be the case for all manner of services.

It's generally held that a server should be up 24/7 in a constant
state.  I remember having this kind of problem when I was on dial-up,
which was always going to be sporadic.  So many things did not handle
having an interface go down.  I had to have a post dial-up rule to
restart NTP, for instance.
 
-- 
 
uname -rsvp
Linux 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure


Dhcpd server usage with USB RDNIS interface that goes up and down

2021-08-19 Thread Terry Barnaby
I have an AM335x based IOT system where the CPU can initially boot over 
its USB interface using RDNIS and TCPIP/DHCP/TFTP. I need to run a DHCP 
server on a Fedora33 host to support the DHCP requests from this CPU. In 
this scenario the CPU brings its USB RDNIS interface up and down about 3 
times.


In a old Fedora system (probably Fedora 23) this worked fine, however I 
am trying to update our boot system to run on Fedora33 and am having 
problems with the DHCP server. It has a basic /etc/dhcp/dhcpd.conf file 
that I have used before that dishes out IP addresses for the subnet 
10.0.0.0 netmask 255.255.255.0 (as below). I have configured a usb0 
interface with NetworkManager that uses a static IP address of 10.0.0.1.


I am having two problems:

1. If you try and start the DHCP server when the usb0 interface is down 
(not connected or CPU not driving a RDNIS interface) then the dhcpd 
server will not start with the error message "Not configured to listen 
on any interfaces!".


2. If the usb0 interface is up, the dhcp server runs and serves an IP 
address to the AM335x fine, but then the AM335x close and opens the USB0 
interface and I see the error message "receive_packet failed on usb0: 
Network is down" and the dhcp server no longer replies to requests on 
the newly come up usb0 interface.


I am guessing that at some time the dhcp server was changed to listen on 
specific network interfaces only rather than a standard host socket 
listening on all networks and that it does not try to reconnect to a 
network interface once that has gone down.


Does anyone know of a configuration option to get the dhcp server to 
listen on all network interfaces in a general way or to retry its 
network connection when the interface goes down and up ?


Or do I have to get NetworkManager to stop/start the DHCP server for 
this particular usb0 network interface (yuck!) ?


Terry



/etc/dhcp/dhcpd.conf

subnet 10.0.0.0 netmask 255.255.255.0 {
    default-lease-time    1209600;    # Two weeks
    max-lease-time        31557600;    # One year
    range            dynamic-bootp 10.0.0.128 10.0.0.250;
    option    subnet-mask        255.255.255.0;
    option    domain-name        "usbnet";
    option    nis-domain        "usbnet";
    option    nis-servers        10.0.0.1;
    option    domain-name-servers    10.0.0.1;
    option    ntp-servers        10.0.0.1;
    next-server            10.0.0.1;
    use-host-decl-names on;
    allow bootp;
    allow booting;

    if substring (option vendor-class-identifier, 0, 10) = "AM335x ROM" {
        filename "vlim/u-boot-spl.bin";
    }
    elsif substring (option vendor-class-identifier, 0, 10) = "DM814x 
ROM" {

        filename "vlim/u-boot-spl.bin";
    }
    elsif substring (option vendor-class-identifier, 0, 17) = "AM335x 
U-Boot SPL"     {

        filename "vlim/u-boot.img";
    }
    else {
        filename "uImage";
    }

}
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure