mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
networks: Support virtual Ethernet (veth) devices
Closes #1767 Signed-off-by: Veiko Aasa <veiko17@disroot.org> [sunil: Add comment and a cosmetic change] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
964051a849
commit
932d2e17f9
@ -43,7 +43,7 @@ class ConnectionForm(forms.Form):
|
||||
"""Base form to create/edit a connection."""
|
||||
name = forms.CharField(label=_('Connection Name'))
|
||||
interface = forms.ChoiceField(
|
||||
label=_('Physical Interface'), choices=(),
|
||||
label=_('Network Interface'), choices=(),
|
||||
help_text=_('The network device that this connection should be bound '
|
||||
'to.'))
|
||||
zone = forms.ChoiceField(
|
||||
@ -120,6 +120,10 @@ class ConnectionForm(forms.Form):
|
||||
def _get_interface_choices(device_type):
|
||||
"""Return a list of choices for a given device type."""
|
||||
interfaces = network.get_interface_list(device_type)
|
||||
# Support for virtual Ethernet devices used in containers
|
||||
if device_type == nm.DeviceType.ETHERNET:
|
||||
interfaces.update(network.get_interface_list(nm.DeviceType.VETH))
|
||||
|
||||
choices = [('', _('-- select --'))]
|
||||
for interface, mac in interfaces.items():
|
||||
display_string = '{interface} ({mac})'.format(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user