On Thu, 2018-12-06 at 20:43 +0100, Andrew Lunn wrote:
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you recognize the sender and know the
> content is safe.
>
>
> > I can have a look at using dormant, but what is change_carrier
> > supposed to do if not this?
>
> It is intended for interfaces which are stacked, like the team driver,
> and for devices which don't have a phy, e.g. tun, and dummy.
>
> > I didn't find a tool for DORMANT, I guess i will have to write one
> > myself(using SIOCGIFFLAGS, SIOCSIFFLAGS)?
>
> ip link should be able to set it.
>
> Try ip link set mode dormant dev eth0
>
> Andrew
Been a bit busy today but now I have played with dormant using ip link and got
some odd results:
# > ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.0.246 netmask 255.255.0.0 broadcast 172.20.255.255
inet6 fe80::ad9c:b230:1da8:1821 prefixlen 64 scopeid 0x20<link>
ether 8c:16:45:89:cf:c6 txqueuelen 1000 (Ethernet)
RX packets 1848903 bytes 736764445 (702.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 627462 bytes 222453345 (212.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xdc200000-dc220000
# > ip link set mode dormant dev eth0
ping sunet.se
PING sunet.se (192.36.171.231) 56(84) bytes of data.
64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=1 ttl=54 time=2.22 ms
64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=2 ttl=54 time=2.17 ms
# > ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.0.246 netmask 255.255.0.0 broadcast 172.20.255.255
inet6 fe80::ad9c:b230:1da8:1821 prefixlen 64 scopeid 0x20<link>
ether 8c:16:45:89:cf:c6 txqueuelen 1000 (Ethernet)
RX packets 1905479 bytes 753549572 (718.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 648266 bytes 224421617 (214.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xdc200000-dc220000
still RUNNING ..
#> ip link show eth0
5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
mode DORMANT group default qlen
state is still UP ?
# > ip link set state dormant dev eth0
# > ip link show eth0
5: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel
state DORMANT mode DORMANT group default qlen 1000
# > ifconfig eth0
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
...
Now both state and not RUNNING :)
but ...
# ping sunet.se
PING sunet.se (192.36.171.231) 56(84) bytes of data.
64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=1 ttl=54 time=2.43 ms
64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=2 ttl=54 time=2.31 ms
I can still ping though. Is this how it is supposed to work ? No sure how state
and mode relate to each other either.
Jocke