I'm new guix and Guile and not a software engineer, so please excuse my
feeble attempt at a patch (attached).
I wasn't able to test it, but I believe it should solve the parent
interface's state problem during boot, which was the root cause for my
issue.
On 19/10/26 07:00, Ludovic Courtès wrote:
Hi Mate,
Mate Gabri <[email protected]> skribis:
Eventually I was able to resolve this by adding an explicit "up"
statement for the primary interface:
(network-link
(name "enp191s0")
(type #f)
(arguments '((up . #t))))
I believe it has to do with the order of how the alias interface gets
created. The primary should be in an up state, before the alias is
defined, otherwise the networking script fails.
Oh, interesting.
Let us know if you can think of a way we can arrange so the problem
doesn’t come up, or a way we can improve documentation.
Ludo’
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 4bfc484b898..775e73e40bc 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -3428,15 +3428,22 @@ (define (alist->keyword+value alist)
#$@(map (match-lambda
(($ <network-link> name type mac-address arguments)
(cond
- ;; Create a new interface
- ((and (string? name) (symbol? type))
- #~(begin
- (link-add #$name (symbol->string '#$type) #:type-args '#$arguments)
- ;; XXX: If we add routes, addresses must be
- ;; already assigned, and interfaces must be
- ;; up. It doesn't matter if they won't have
- ;; carrier or anything.
- (link-set #$name #:up #t)))
+ ;; Create a new interface
+ ((and (string? name) (symbol? type))
+ #~(begin
+ ;; Ensure parent is up for VLAN interface
+ #$@(if (eq? '#$type 'vlan)
+ #~(let ((parent-link (assoc-ref '#$arguments 'link)))
+ (when parent-link
+ (format #t "Bringing up parent interface '~a' for VLAN...~%" parent-link)
+ (false-if-exception (link-set parent-link #:up #t))))
+ #~#f)
+ (link-add #$name (symbol->string '#$type) #:type-args '#$arguments)
+ ;; XXX: If we add routes, addresses must be
+ ;; already assigned, and interfaces must be
+ ;; up. It doesn't matter if they won't have
+ ;; carrier or anything.
+ (link-set #$name #:up #t)))
;; Amend an existing interface
((and (string? name)