43 Commits

Author SHA1 Message Date
Ilia Ross
8ba6a02122 Merge branch 'master' into dev/add-deb-dhcpcd-support-1607 2026-06-21 00:00:06 +02:00
Ilia Ross
cb4a322042 Fix active virtual interface handling
ⓘ Treat Linux active virtual interfaces as secondary IP addresses instead of independent links, fixing alias parsing, hiding invalid status controls, rejecting down-state creation, and removing existing aliases with ip addr del when needed.

Reproduce path:

Example repro before this fix:

1. Go to **Network Configuration → Network Interfaces → Active Now**.
2. Click **Add a new interface**.
3. Enter:

```text
Name: enp0s5:1
IPv4 address: 10.211.55.21
Netmask: 255.255.255.0
Status: Down
```

4. Click **Create**.

Before the fix, Webmin could still create the alias or handle it inconsistently, because `enp0s5:1` is not a real link that can be “down”. It is just an extra IP address on `enp0s5`.

Expected after the fix:

- The UI should not offer `Status` for active virtual aliases.
- If someone submits `up=0` manually anyway, Webmin rejects it with:
  `Virtual interfaces cannot be created with down status`
- If an existing active virtual alias is saved as down through lower-level code, Webmin removes the IP using something like:

```bash
ip addr del 10.211.55.21/24 dev enp0s5
```
2026-06-20 15:23:09 +02:00
Ilia Ross
f2782073ce Fix to remove factored-out virtual alias changes 2026-06-20 15:09:31 +02:00
Ilia Ross
7ebe3f7dfa Add dhcpcd network backend for Debian and Raspberry Pi OS
This PR adds dhcpcd backend support for Debian and Raspberry Pi OS network configuration. It detects dhcpcd only as a final fallback after Netplan, NetworkManager, and ifupdown, preventing Webmin from incorrectly falling back to `/etc/network/interfaces` on dhcpcd-managed systems.

The new backend reads and writes `/etc/dhcpcd.conf`, including DHCP and static IPv4/IPv6 configuration, gateways, static routes, DNS servers, search domains, MTU, and virtual IPv4 aliases. It also supports implicit DHCP-managed interfaces for default dhcpcd setups with no explicit interface blocks, and handles `allowinterfaces` / `denyinterfaces` behavior.

This PR also fixes apply/delete flows for dhcpcd-managed interfaces and virtual aliases, avoids rewriting generated `/etc/resolv.conf`, preserves spacing/comments in touched hosts and nsswitch files, and tightens Active Now handling so virtual aliases are treated as IP addresses rather than independent links.

https://github.com/webmin/webmin/issues/1607
2026-06-20 01:57:50 +02:00
Jamie Cameron
47043a41c5 Bridge support in Netplan 2023-04-16 20:29:19 -07:00
Jamie Cameron
4a1abb0c10 Fix turning off broadcast address 2020-09-04 11:16:30 -07:00
Jamie Cameron
b593551c5f For systems that don't need the broadcast address to be set in the config file, don't force it to be set https://github.com/webmin/webmin/pull/1278 2020-08-29 17:27:29 -07:00
Jamie Cameron
0177ad2e88 Copy active default route to saved one when switching from DHCP https://github.com/webmin/webmin/issues/1266 2020-07-24 13:42:30 -07:00
Mike Steinmetz
edb9a43a89 MM-5521 escape inputs for some error messages 2020-04-23 15:19:44 +02:00
Jamie Cameron
7249e646e8 Allow en* interface names https://github.com/webmin/webmin/issues/930 2019-05-26 09:37:02 -07:00
Jamie Cameron
a6e4dc21ad Bridging on bonded interfaces is also possible https://www.virtualmin.com/node/60118 2019-01-05 11:13:21 -08:00
Jamie Cameron
02ad765408 Since the boot-time interface config is now copied from the old config, fix the way attributes are set 2018-11-17 10:26:55 -08:00
Jamie Cameron
74c4386779 Need to pass in current interface list 2018-11-03 16:52:28 -07:00
Jamie Cameron
2a18415aee Deal with interface names like en3s5 https://sourceforge.net/p/webadmin/bugs/5164/ 2018-07-25 23:14:41 -07:00
Jamie Cameron
cf9eaaa09b Instead of copying fields to the new interface object, just duplicate it 2018-07-06 16:24:10 -07:00
Jamie Cameron
14fe278102 Handle interface names like enp4s7 https://github.com/webmin/webmin/issues/803 2018-02-08 16:22:14 -08:00
casparsmit
f8982ddf4f Add common spanning tree tunables for bridges 2016-04-12 14:25:03 +02:00
Jamie Cameron
9189c1446a Support configure a primary teaming interface, thanks to Caspar Smit 2016-04-05 21:40:44 -07:00
Jamie Cameron
797f4d383d Fix classification of ethernet interfaces 2014-08-07 12:45:47 -07:00
Jamie Cameron
dc75902be8 Allow bridge over VLAN, and always ifdown before ifup (thanks to Caspar Smit) 2014-02-04 13:30:34 -08:00
Jamie Cameron
47083c3acf Copy IPv6 gateway from old interface http://virtualmin.com/node/27700 2013-05-28 17:19:39 -07:00
Jamie Cameron
139b4fb666 Allow creation of a bridge with no real interface 2012-11-26 14:36:46 -08:00
Jamie Cameron
e15b434d04 Allow setting of MTU on interfaces with no IP 2012-08-31 22:52:16 -07:00
Jamie Cameron
ac706b3e78 Redhat VLAN support 2012-08-28 13:55:24 -07:00
Jamie Cameron
8fd020858e Bonding support on CentOS / Redhat 2012-08-24 16:18:22 -07:00
Jamie Cameron
3211af888b Only set bridge field on a bridge
https://www.virtualmin.com/node/19705
2011-10-05 12:29:08 -07:00
Jamie Cameron
f63663f1f6 More work on bridge support 2011-06-28 09:11:06 -07:00
Jamie Cameron
be8675fc88 Start of work on bridge support 2011-06-27 23:20:10 -04:00
Jamie Cameron
52e02d51d3 More work on Solaris support for IPv6 2011-01-20 22:00:11 -08:00
Jamie Cameron
ee5e50beef Option to disable IPv6 for an interface 2011-01-20 17:30:55 -08:00
Jamie Cameron
d7043e0f7f Work on IPv6 address auto-configuration 2011-01-20 16:55:21 -08:00
Jamie Cameron
e329e2991d Debian boot-time IPv6 interface editing now working 2011-01-19 17:02:13 -08:00
Jamie Cameron
ab6f2f9586 IPv6 address management for active interfaces 2011-01-18 21:42:45 -08:00
Jamie Cameron
a9d5c6e244 Start of work on IPv6 support 2011-01-15 11:45:40 -08:00
Jamie Cameron
151bd0590a Compute broadcast dynamically 2010-02-02 09:39:10 -08:00
Jamie Cameron
5206e921d9 MAC address editing 2009-12-14 21:34:05 -08:00
Jamie Cameron
4efe320bc0 Updated bonding support to use the new format in Debian 5.0, thanks to Caspar Smit. 2009-08-23 18:02:29 -07:00
Jamie Cameron
ef50b0abe7 Bonding interfaces fix 2009-03-17 20:40:59 +00:00
Jamie Cameron
9a32259468 Make default MTU clearer 2008-08-27 04:38:14 +00:00
Jamie Cameron
c46ab04bff IPv6 support on Debian 2008-06-18 20:43:23 +00:00
Jamie Cameron
86b2133e9f Added support for comments on interfaces 2007-11-16 23:21:33 +00:00
Jamie Cameron
f4bf66ff56 VLAN and bonding support 2007-11-11 21:42:45 +00:00
Jamie Cameron
fc1c1b243f Initial checkin of Webmin 2007-04-12 20:24:50 +00:00