552 Commits

Author SHA1 Message Date
Ilia Ross 5a101c405e Fix bridge handling for interfaces with arbitrary names
This small PR fixes deletion of bridges with arbitrary names, like vmbr0, by honoring the boot config bridge flag instead of relying only on name patterns.

It also makes the Debian config parser treat any interface with bridge_ports as a bridge, which previously caused bridge options to be lost on re-save.
2026-08-20 04:53:02 +02:00
Ilia Ross bd0f9f9e5f Fix to report virtual interface deletion failures 2026-08-10 23:17:25 +02:00
Ilia Ross cceda25a60 Fix to restrict live deletion to virtual network devices
https://github.com/webmin/webmin/pull/2795
2026-08-10 23:09:09 +02:00
Ilia Ross 95cb100e8b Merge pull request #2795 from macmon/fix/net-virtual-iface-deletion
MM-12032 Fix bond/VLAN/bridge not removed from active list on delete
2026-08-10 23:00:45 +02:00
Ilia Ross b6db862133 Fix to restrict bonding mode to valid values 2026-08-07 04:04:02 +02:00
Jamie Cameron 93ceede9bb Check sanity of bonding interface field names 2026-08-04 10:55:58 -07:00
Jamie Cameron 1031b59b9c Ensure that option names or values that would break the config are never written 2026-08-04 10:08:46 -07:00
Jamie Cameron b3dad7f513 Sometimes fe80 link-local addresses cannot be added because they are already always present 2026-07-29 11:01:46 -07:00
Mike Steinmetz b050127ded MM-12032 Fix bond/VLAN/bridge not removed from active list on delete
delete_bifcs.cgi and save_bifc.cgi only called deactivate_interface()
which brings the link down but never removes the virtual device.
Added destroy_interface_device() that does ip link delete for these.

Also had to add bridge creation (ip link add type bridge) because unlike
bond (81d44f8) and VLAN (7761066) that was still missing.

Other fixes in this commit:

debian-linux-lib.pl: bonding opts were single-element arrays causing
trailing spaces in /etc/network/interfaces on every save.

linux-lib.pl: ip link set up/down was gated behind a
bond/vlan/no-ifconfig check but ip addr add runs unconditionally - so
interfaces got an IP but stayed DOWN. Dropped the unnecessary guard.
2026-07-16 15:01:51 +02:00
Ilia Ross 77610666cc Fix live activation of Linux VLAN interfaces
ⓘ Create and detect VLAN devices before applying live configuration, parse live VLANs with their physical parent instead of a virtual alias, normalize persisted dotted VLAN names when the parent device exists, consistently target the real VLAN device across the ip, ifup and vconfig paths, skip recreating existing devices or activating absent disabled ones, and add regression coverage.

https://github.com/webmin/webmin/pull/2785
2026-07-11 13:33:58 +02:00
Ilia Ross 81d44f8491 Fix live activation of Linux bond interfaces
ⓘ Create and configure missing bond devices with ip link, attach partner interfaces before assigning addresses, avoid legacy module auto-creation when ip is available, and add regression coverage.

Ref.: https://github.com/webmin/webmin/pull/2777
2026-06-27 18:16:38 +02:00
Ilia Ross 0dbb5d2f89 Fix to share ifupdown parser with network detection 2026-06-23 15:00:32 +02:00
Ilia Ross 8ba6a02122 Merge branch 'master' into dev/add-deb-dhcpcd-support-1607 2026-06-21 00:00:06 +02:00
Ilia Ross 74fd072551 Fix to drop unnecessary parens 2026-06-20 20:23:36 +02:00
Ilia Ross b75a95dd42 Fix missing space after if 2026-06-20 20:22:08 +02:00
Ilia Ross 0cf6654fd9 Fix Postfix localhost destination after hostname domain change
- When the system hostname domain changes, update `localhost.<old-domain>` in Postfix `mydestination` to `localhost.<new-domain>`.

- This sits alongside the existing hostname/FQDN updates for Postfix destinations.

Previous behavior:

`save_dns.cgi` only updated Postfix `mydestination` entries that exactly matched:

- the old short hostname, like `host`
- the old FQDN, like `host.old-domain.test`

It did **not** update:

- `localhost.old-domain.test`

So if you changed:

```text
host.old-domain.test
```

to:

```text
host.new-domain.test
```

Postfix could become:

```text
mydestination = host.new-domain.test, host, localhost.old-domain.test
```

After this hunk, it also updates that localhost domain entry:

```text
localhost.old-domain.test
```

to:

```text
localhost.new-domain.test
```
2026-06-20 15:33:22 +02:00
Ilia Ross c08468ec48 Fix network config spacing preservation
- Preserve existing spacing and inline comments when rewriting `/etc/nsswitch.conf` `hosts:` lines.

- Preserve indentation, comment prefix, inline comments, and field separators when rewriting `/etc/hosts` rows.

- Add tests for the `nsswitch.conf` spacing/comment behavior.
2026-06-20 15:27:28 +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 090aed60df Fix to remove unrelated network formatting cleanups 2026-06-20 14:44:51 +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
Imre Eilertsen 5f72e2e97e Update no 2026-06-15 13:50:04 +02:00
Ilia Ross ad06644617 Add minimal Alpine Linux compatibility
This PR adds baseline Alpine Linux support in Webmin with OS detection, APK package and update backend, OpenRC boot integration, ifupdown-style networking support and DHCPD defaults.

https://github.com/webmin/webmin/issues/2353
2026-06-06 23:11:25 +02:00
Ilia Ross 6574373761 Fix to detect NetworkManager networking on Debian
ⓘ Prefer Netplan when Debian has Netplan YAML config, otherwise select the existing NetworkManager backend for Debian systems with saved NM connection profiles, with regression tests for backend selection.

https://github.com/webmin/webmin/issues/2559
2026-06-02 01:33:59 +02:00
Ilia Ross b33b9fb0a0 Fix NetworkManager IPv6 DNS nameserver saving
https://github.com/webmin/webmin/issues/2559
2026-06-02 01:12:24 +02:00
Ilia Ross 7f63875c42 Drop unnes quotemeta for params to be used 2026-05-19 11:25:34 +02:00
Ilia Ross 846bbb8252 Fix to preserve Netplan YAML when saving DNS
* Note: Preserve existing Netplan indentation when updating DNS settings, validate with netplan generate before applying, and surface apply errors to avoid network loss from malformed YAML.
2026-05-19 00:31:34 +02:00
Ilia Ross 695c78f631 Fix previously broken Farsi translations 2025-05-30 21:36:00 +03:00
Ilia Ross 833292c0d1 Add exported German language-neutral strings
https://github.com/webmin/webmin/discussions/2482
https://forum.virtualmin.com/t/on-the-rejection-of-gender-neutral-language/133527
2025-05-26 14:48:11 +03:00
Ilia Ross 501698ad4b Fix to use German rules most people already accept 1/2
https://github.com/webmin/webmin/discussions/2482
2025-05-24 20:43:25 +03:00
Jamie Cameron 8358bd20af Turn off caching when reading network manager config files, as they may be modified by the nm cli command
https://forum.virtualmin.com/t/virtualmin-virtualserver-ip-copy-to-services/133442/12
2025-05-20 16:43:39 -07:00
Jamie Cameron 2aee714a81 Handle case where two interfaces are modified
https://github.com/webmin/webmin/issues/1546
2025-03-23 10:42:45 -07:00
Ilia Ross 85e7f6c292 Fix to filter out scope identifier
* We could support it but it would be much more work
2025-03-10 13:32:39 +02:00
Ilia Ross 9fa35cc2c9 Fix to save IPv6 nameservers 2025-03-10 13:31:32 +02:00
Jamie Cameron 9ba9bfd524 Merge branch 'master' of github.com:webmin/webmin 2025-03-06 19:03:47 -08:00
Jamie Cameron 6c5c5fa225 No need for modprobe since IPv6 is always in the kernel these days
https://github.com/webmin/webmin/issues/2432
2025-03-06 18:51:14 -08:00
Ilia Ross 495a196b2f Fix type when adding addr 2025-03-06 14:22:49 +02:00
Jamie Cameron 50eb61b89e Use the ip command instead of ifconfig 2025-03-05 20:56:42 -08:00
MacSteini f799102e7a Update de 2025-03-04 11:34:53 +00:00
Ilia Ross 6d10d5aa55 Update translations 2025-02-27 13:56:29 +02:00
Ilia Ross 1cef7128d1 Fix to improve wording when applying network 2025-02-27 13:54:39 +02:00
MacSteini c89ff93b4d Update de 2025-02-25 00:00:14 +00:00
Jamie Cameron d54e7217d6 Log the apply action
https://github.com/webmin/webmin/issues/2422
2025-02-24 15:29:00 -08:00
Ilia Ross f880192526 Remove languages with 0% coverage
https://github.com/webmin/webmin/issues/2403#issuecomment-2652613588
2025-02-12 13:19:49 +02:00
Jamie Cameron c6a0aa1f15 Check for separate gateway field https://forum.virtualmin.com/t/add-new-server-is-removing-the-gateway/131904 2025-02-04 19:52:54 -08:00
MacSteini 162206949f Consecutive Spaces Replacement
Replaced multiple consecutive spaces with a single space
2024-12-16 16:57:09 +00:00
MacSteini 5ea0cc6b42 Trailing Spaces Removal
Removed trailing spaces
2024-12-16 15:16:55 +00:00
MacSteini 477982776c Updated de
Corrections (UTF-8, new lines at file end), amendments, updates
2024-11-26 01:43:34 +00:00
MacSteini 54793b4596 Update de 2024-09-07 16:32:17 +01:00
Jamie Cameron 60a9419cc3 Use static routes to set the default gateway https://forum.virtualmin.com/t/ubuntu-and-network-configurations/126890 2024-05-25 22:18:53 -07:00