[En-Nut-Discussion] ppp and dhcp

Dušan dferbas at solarmonitor.cz
Wed Apr 22 21:39:20 CEST 2020


Yes, it is needed to preserve confnet in EEPROM from being overwritten
with values obtained from IPCP during PPP negotiation, if PPP is still 
active.
I think it does not make much sense to store IP address, DNS servers are 
not stored anyway.

Although Nut/Net can handle multiple devices, I think ifconfig.c does 
not count with more than 1.

Then the 0.0.0.0 gateway entry in routing table should stay untouched,
and because NutNetIfSetup() is adding to routing table,
there should be delete for all routing entries on a device, prior to 
NutNetIfSetup() call.
This should be done in NutDhcpIfConfig.

Also it is nice to start dhcp with DHCPST_RENEWING, after someone 
unplugs cable from a board,
because this speeds up whole process (minimally there is a 4 second gap 
to catch all offers from dhcp servers).

There is a common PHY handling, which can be used to get link status,
as all PHYs, I know, have this info in a same register.

So the question is, if it is time to change how these routines cooperates?
- confnet array or preserving only 1 interface?
- how to get info if PPP is active, when we are in ethernet dev "context"?
I.e. use devPpp.dev_dcb->dcb_ipcp_state == PPPS_OPENED,
or some kind of callback fn, settable by ioctl?

*Dušan*

On 22.4.2020 20:51, Nathan Moore wrote:
> I did this years ago for a private project.  I made a new function pointer
> in the network device struct that would be called by NutNetIfSetup to do
> the different things required for different network device types (we also
> added another customs network device).  The PPP stopped saving to flash,
> but I don't think I made it able to handle multiple Ethernet devices.
> We made a rugged little router/gateway/firewall out of an AVR Ethernut
> based design and a cellular modem.
>
> On Wed, Apr 22, 2020 at 1:40 PM Dušan <dferbas at solarmonitor.cz> wrote:
>
>> Hi guys,
>>
>> we are using Nut/OS for a board, which uses ethernet and PPP concurrently.
>> In a way, you can enable PPP and if this connection is opened,
>> you still can have access through ethernet.
>>
>> We come to an issue, if dhcp is used on ethernet.
>>
>> Currently now, we have a working solution, tested on several locations.
>> It requires to modify NutNetIfSetup() - do not seed default gw, if ppp
>> is active.
>>
>> ----------
>> Is there anyone interested in this?
>> If yes, I can try to match it to the current Nut and publish.
>>
>> Dušan Ferbas*
>> *
>>
>> _______________________________________________
>> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion


More information about the En-Nut-Discussion mailing list