在 Ubuntu 16.04 上,我使用 nmcli 来管理网络接口。我有这样的联系。
NAME UUID TYPE DEVICE
link-local-0 da55e0dd-c5a2-414c-9ec5-f17b781df1a4 802-3-ethernet eth0
ethernet-0 395f7a42-fe6c-4863-8527-1d94d9946da9 802-3-ethernet --
当设备启动并通过以太网直接连接到另一台计算机时,大约需要 120 秒,ethernet-0 才会超时并继续连接到 link-local-0 连接。我的目标是让设备在没有插入网络的情况下可以通过对等连接立即访问。我尝试在 15 和 2 之间更改 ipv4.dhcp-timeout 值,但似乎没有任何区别,我无法找到配置超时以使第一个连接更快失败的位置。
nmcli 工具,版本 1.2.6 。该设备是无头的。Ubuntu 16.06。avahi zero conf 守护进程也在运行。
- 当 dhcp 在初始启动后 0-5 秒内不可用但仍在使用网络管理器时,如何让设备使用 169.254.0.0/16 地址配置其自身。
- 网络管理器支持调度程序脚本,制作调度程序脚本是解决这个问题的正确方法吗?
- 我只是以错误的方式解决这个问题吗?
这是每个接口的配置
nmcli> print
===============================================================================
Connection profile details (ethernet-0)
===============================================================================
connection.id: ethernet-0
connection.uuid: 395f7a42-fe6c-4863-8527-1d94d9946da9
connection.interface-name: eth0
connection.type: 802-3-ethernet
connection.autoconnect: yes
connection.autoconnect-priority: 2
connection.timestamp: 1543331562
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries:
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: -1 (default)
-------------------------------------------------------------------------------
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: yes
802-3-ethernet.mac-address: --
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options:
802-3-ethernet.wake-on-lan: 1 (default)
802-3-ethernet.wake-on-lan-password: --
-------------------------------------------------------------------------------
ipv4.method: auto
ipv4.dns:
ipv4.dns-search:
ipv4.dns-options: (default)
ipv4.dns-priority: 0
ipv4.addresses:
ipv4.gateway: --
ipv4.routes:
ipv4.route-metric: -1
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-timeout: 2
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dad-timeout: -1 (default)
-------------------------------------------------------------------------------
ipv6.method: auto
ipv6.dns:
ipv6.dns-search:
ipv6.dns-options: (default)
ipv6.dns-priority: 0
ipv6.addresses:
ipv6.gateway: --
ipv6.routes:
ipv6.route-metric: -1
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.ip6-privacy: -1 (unknown)
ipv6.addr-gen-mode: stable-privacy
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
-------------------------------------------------------------------------------
本地链接
Connection profile details (link-local-0)
===============================================================================
connection.id: link-local-0
connection.uuid: da55e0dd-c5a2-414c-9ec5-f17b781df1a4
connection.interface-name: eth0
connection.type: 802-3-ethernet
connection.autoconnect: yes
connection.autoconnect-priority: 1
connection.timestamp: 1543420131
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries:
connection.gateway-ping-timeout: 0
connection.metered: unknown
connection.lldp: -1 (default)
-------------------------------------------------------------------------------
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: yes
802-3-ethernet.mac-address: --
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.mac-address-blacklist:
802-3-ethernet.mtu: auto
802-3-ethernet.s390-subchannels:
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options:
802-3-ethernet.wake-on-lan: 1 (default)
802-3-ethernet.wake-on-lan-password: --
-------------------------------------------------------------------------------
ipv4.method: link-local
ipv4.dns:
ipv4.dns-search:
ipv4.dns-options: (default)
ipv4.dns-priority: 0
ipv4.addresses:
ipv4.gateway: --
ipv4.routes:
ipv4.route-metric: -1
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-timeout: 0
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dad-timeout: -1 (default)
-------------------------------------------------------------------------------
ipv6.method: auto
ipv6.dns:
ipv6.dns-search:
ipv6.dns-options: (default)
ipv6.dns-priority: 0
ipv6.addresses:
ipv6.gateway: --
ipv6.routes:
ipv6.route-metric: -1
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.ip6-privacy: -1 (unknown)
ipv6.addr-gen-mode: stable-privacy
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
-------------------------------------------------------------------------------
路由表
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 600 0 0 wlan0
link-local * 255.255.0.0 U 100 0 0 eth0
192.168.1.0 * 255.255.255.0 U 600 0 0 wlan0
224.0.0.0 * 240.0.0.0 U 100 0 0 eth0