ifdown/ifup and friends

ifdown/ifup and friends

Lior Okman lior at okman.name
Wed Apr 25 09:06:59 IDT 2018


Hi,

On my current host I have the following:

$ ip addr show enp4s0
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN
group default qlen 1000
    link/ether 70:85:c2:66:5a:96 brd ff:ff:ff:ff:ff:ff

Running the "set link down" command yields this:

$ sudo ip link set down enp4s0
$ ip addr show enp4s0
2: enp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default
qlen 1000
    link/ether 70:85:c2:66:5a:96 brd ff:ff:ff:ff:ff:ff

This seems to do what you want it to. The other way works as well.

$ sudo ip link set up enp4s0
$ ip addr show enp4s0
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN
group default qlen 1000
    link/ether 70:85:c2:66:5a:96 brd ff:ff:ff:ff:ff:ff

My system is a debian SID host, except that it is using the 4.16.3 kernel.

--
Lior

On Tue, Apr 24, 2018 at 6:53 PM, Oleg Goldshmidt <pub at goldshmidt.org> wrote:

> Tzafrir Cohen <tzafrir at cohens.org.il> writes:
>
> >> The problem is that whatever I do in stop() (or by hand), e.g.,
> >>
> >> * ifconfig eth3 down
> >> * ifdown --force eth3 (and --no-scripts, and whatever - on Debian)
> >> * ip link set eth3 down
> >
> > Why don't you stop the interface with 'ifdown'? Also: why not use ip
> > (and generally: iproute2 tools) everywhere?
>
> None of them work (in the sense described in the original post - no
> difference in the output of ifconfig before and after). I tried all of
> them, as hinted in the quoted part above.
>
> > "auto" only means this interface is to be started at boot. So it indeed
> > should be irrelevant.
>
> I know. I was clutching at straws. Interfaces marked "auto" are treated
> specially in some sense (e.g., ifup -a), so I tried to see if there was
> any difference. None.
>
> I also gre suspicious about scripts under /etc/network/if-*.d/ so I
> tried ifdown --no-scripts (in addition to --force), in vain.
>
> Let me also emphasize that the actual code in our scripts does not
> matter because things do not work when I run commands by hand, either.
>
> Thanks,
>
> --
> Oleg Goldshmidt | pub at goldshmidt.org
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20180425/03b7c750/attachment-0001.html>


More information about the Linux-il mailing list