:: Re: [DNG] Network Configuration Gui…
Top Page
Delete this message
Reply to this message
Author: Ralph Ronnquist
Date:  
To: dng
Subject: Re: [DNG] Network Configuration Guide.
On Sun, Oct 12, 2025 at 07:54:12AM -0700, Peter via Dng wrote:
> > > Is the line beginning "ifup" in the table here incorrect?
> > > https://en.wikipedia.org/wiki/Iproute2
>
> From:    Ralph Ronnquist via Dng <dng@???>
> Date:    Mon, 13 Oct 2025 01:24:25 +1100
> > > No.

> >
> > Sorry, yes it's incorrect.
>
> Incorrect because it doesn't also set an address?
>
> Because it assumes an address is specified in /etc/network/interfaces?
>
> Something else?


It's incorrect because it, "ifup $iface", rather means to "apply" a
configuration stanza from /etc/network/interfaces, regardless of what
$iface actually is. Normally you would use it for simple configuration
of a existing interface $iface, and in that case it results in pretty
much the same as "ip link" and "ip address". But you can also have
complex configurations, e.g., the following (untested) sketch for
running a local DNS server (nsd) within a network namespace:

########################################$
iface dns0 inet static
    pre-ip ip netns create dnsns
    pre-up ip link add dns0 type veth peer name dns1 netns dnsns
    address 10.3.4.1/28
    up ip netns exec dnsns ifup dns1
    up ip netns exec dnsns service nsd start
    up iptables -t nat -A POSTROUTING -s 10.3.4.2/32 -j MASQUERADE
    down ip netns exec dnsns service nsd stop || true
    down iptables -t nat -D POSTROUTING -s 10.3.4.2/32 -j MASQUERADE || true
    post-down ip link del dns0
    post-down ip netns del dnsns


iface dns1 inet static
    address 10.3.4.2/28
    gateway 10.3.4.1
########################################


With that, the nsd service is psun up within a local network namespace
by the command "ifup dns0", and the setup it's taken down with
"ifdown dns0".

So "ifup" is not anywhere near the same as "ip link" as command
concept.

Ralph.