r0b*_*rts 4 linux command-line networking tcp-ip network-interface
我正在设置一个基于Arch/ Manjaro的机器,它只是偶尔会连接到网络。即大部分时间它的以太网卡是断开的。
我遇到了这个奇怪的问题 - 当我尝试使用网络命令时,接口关闭(我坐在它旁边,我的笔记本电脑有 Wi-Fi 互联网连接)。所以我不确定它是否正常工作。
我找到了答案:SkipNoCarrier=yes在netctl配置文件中使用。它位于Manjaro StaticIP wiki 和 Arch netctl页面中。
像这样例如:
对于静态 IP 配置,将
/etc/netctl/examples/ethernet-static示例配置文件复制 到/etc/netctl并根据需要修改接口、地址、网关和 DNS)。例如:
Run Code Online (Sandbox Code Playgroud)/etc/netctl/my_static_profile Interface=enp1s0 Connection=ethernet IP=static Address=('10.1.10.2/24') Gateway=('10.1.10.1') DNS=('10.1.10.1')
在此处链接到官方 Arch Wiki 。
这当然只有在您不使用网络管理器或类似的东西来控制您的网络时才有效。