您尚未登录。

#1 2013-08-08 01:44:27

Laxtiz
会员
注册时间: 2013-08-08
帖子: 1

请教netctl管理Ethernet的静态IP配置

我在Raspberry Pi上使用ArchLinuxArm
之前使用netcfg的时候,从/etc/network.d/example/ethernet-static 复制的配置文件,一点问题都没有,通电之后就是设置好的静态IP

昨天格式化SD卡写入最新7月22日的镜像,然后 netctl 配置 静态IP ,一直无法生效
journalctl -xn 完全看不出问题在哪

是不是netctl的配置文件对引号有讲究?

# cat /etc/netctl/server
Description='A basic static ethernet connection'
Interface=eth0
Connection=ethernet
IP=static
Address='192.168.1.214/24'
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway='192.168.1.1'
DNS=('114.114.114.114')
SkipNoCarrier=yes

## For IPv6 autoconfiguration
#IP6=stateless

## For IPv6 static address configuration
#IP6=static
#Address6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
#Routes6=('abcd::1234')
#Gateway6='1234:0:123::abcd'

# journalctl -xn
-- Unit netctl@server.service has begun starting up.
Aug 08 02:44:48 raspi network[311]: Starting network profile 'server'...
Aug 08 02:44:48 raspi network[311]: The interface of network profile 'server' is already up
Aug 08 02:44:48 raspi systemd[1]: netctl@server.service: main process exited, code=exited, status=1/FAILURE
Aug 08 02:44:48 raspi systemd[1]: Failed to start A basic static ethernet connection.
-- Subject: Unit netctl@server.service has failed

# systemctl status netctl@server
netctl@server.service - A basic static ethernet connection
   Loaded: loaded (/etc/systemd/system/netctl@server.service; enabled)
   Active: failed (Result: exit-code) since Thu 2013-08-08 02:44:48 CST; 10min ago
     Docs: man:netctl.profile(5)
  Process: 311 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE)

Aug 08 02:44:48 raspi network[311]: Starting network profile 'server'...
Aug 08 02:44:48 raspi network[311]: The interface of network profile 'server' is already up
Aug 08 02:44:48 raspi systemd[1]: netctl@server.service: main process exited, code=exited, status=1/FAILURE
Aug 08 02:44:48 raspi systemd[1]: Failed to start A basic static ethernet connection.
Aug 08 02:44:48 raspi systemd[1]: Unit netctl@server.service entered failed state.

问题解决了,关掉dhcpcd即可
# systemctl stop dhcpcd@eth0
# systemctl disable dhcpcd@eth0

最近编辑记录 Laxtiz (2013-08-08 03:06:57)

离线

页脚