RE: I'd like to use the upstream DHCP server when using network sharing.



I'll try to explain.

I have three interfaces.   I'll call them eth0, eth1 and wlan0.
Normally, we create a bridge, br0, and enslave eth0 and eth1.  We assign an
IP to br0 (DHCP) and it can access devices connected to eth0 and eth1.
Those devices also can access each other, too.  A DHCP server is upstream on
eth0.
Now, we want to use wlan0 instead of eth0.  So, we create br0 and only
enslave eth1.  Br0 is set to DHCP.
Wlan0 connects to a NAT/PAT access point with WPA2. It serves DHCP.
Everything works as expected.  It gets an address from the access point DHCP
pool.
Before sharing, we add a config file in
/etc/NetworkManager/dnsmasq-shared.d/.  There is only one setting in the
file.  "interface=br0"  This forces NetworkManager's dnsmasq to only listen
on br0.  This prevents inference with other dnsmasq instances that we are
running.  
We also assign an ipv4.addresses to br0 the br0 connection, so the DHCP pool
range will be determined.
We enable sharing on br0.  There is some magic that happens here.  I haven't
looked at the code too much.  When br0 is shared, what actually happens?
Anyway, NetworkManager seems to use wlan0 without any configuration by us.
Devices behind eth1 get addresses from the correct pool and can access
devices on the other side of the access point.

That's a lot of explanation.  Maybe we are thinking of this backwards.
Should we share wlan0?  Suggestions are welcome.

We'd like to convince NetworkManager's dnsmasq to forward or relay or ignore
DHCP requests so that they are handled by the DHCP server on the access
point.  Suggestions are welcome.

Finally, we noticed that traffic originating at br0, say, ping -I br0
x.x.x.x, where x.x.x.x is on the other side of access point, does not work.
Traffic the other way from br0 to devices behind eth1 will work.  

Thanks for any and all suggestions.


Mark K Vallevand
Unisys | 651-635-7708 | mark vallevand unisys com 



THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is for use only by the intended recipient. If you received this
in error, please contact the sender and delete the e-mail and its
attachments from all devices.
   

Outside of a dog, a book is man's best friend.
Inside of a dog, it's too dark to read.
-  Groucho


-----Original Message-----
From: Beniamino Galvani <bgalvani redhat com> 
Sent: Tuesday, January 26, 2021 10:28 AM
To: Vallevand, Mark K <Mark Vallevand UNISYS com>
Cc: networkmanager-list gnome org
Subject: Re: I'd like to use the upstream DHCP server when using network
sharing.

On Tue, Jan 26, 2021 at 01:58:53PM +0000, Vallevand, Mark K wrote:
Actually, I am using a bridge.  It is currently between two NICs.  
We removed the 'upstream' NIC from the bridge and then enabled
NetworkManager interface sharing on the bridge.
NetworkManager selects the Wi-Fi connection and creates all the plumbing
and
it works.

What does "selects" mean here?

Sorry, I didn't understand the configuration scenario. Do you want to
share the Wi-Fi connectivity to the bridge, or the other way around?
How is the Wi-Fi connection configured (DHCP, static, no addressing)?
Where do you have the default route?

There are some issues.
The first on that list is that we'd like to convince the dnsmasq started
by
NetworkManager to proxy or forward DHCP request to the Wi-Fi connection.

NetworkManager doesn't support that directly, but perhaps you can add
custom configuration for dnsmasq in
/etc/NetworkManager/dnsmasq-shared.d/ .

Beniamino

Attachment: smime.p7s
Description: S/MIME cryptographic signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]