[systemd-devel] static IP inside container
arnaud gaboury
arnaud.gaboury at gmail.com
Sun Feb 23 06:55:30 PST 2014
Dear all,
I set up a arch linux container on my arch box.
The container (dahlia) boots, works and connect fine.
Now I want to set up a static IP on the container, and I must admit I am
loosing my mind.
The overall set up :
on host :
dhcpcd at enp7s0.service - dhcpcd on enp7s0
Loaded: loaded (/usr/lib/systemd/system/dhcpcd at .service; enabled)
Active: active (running) since Sun 2014-02-23 14:44:07 CET; 53min ago
Process: 382 ExecStart=/usr/bin/dhcpcd -q -w %I (code=exited,
status=0/SUCCESS)
Main PID: 515 (dhcpcd)
CGroup: /system.slice/system-dhcpcd.slice/dhcpcd at enp7s0.service
└─515 /usr/bin/dhcpcd -q -w enp7s0
$ ip addr
.......
inet 192.168.1.87/24 brd 192.168.1.255 scope global enp7s0
--> Shall I use a bridge on host ?
On guest :
I disabled dhcpcd at .service, then
I was thinking using this profile (named dahliaVM) with netctl :
Description='A basic static ethernet connection'
Interface=enp7s0
Connection=ethernet
IP=static
Address=('192.168.1.23/24' '192.168.1.87/24')
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway='192.168.1.254'
DNS=('212.147.10.180' '212.147.10.162')
the etc/systemd/system/netctl at dahliaVM.service is here with inside:
[Unit]
Description=A basic static ethernet connection
BindsTo=sys-subsystem-net-devices-enp7s0.device
After=sys-subsystem-net-devices-enp7s0.device
Unfortunately this setup do not work.
gab at dahlia ➤➤ ~ % systemctl status netctl at dahliaVM.service
netctl at dahliaVM.service - A basic static ethernet connection
Loaded: loaded (/etc/systemd/system/netctl at dahliaVM.service; static)
Active: inactive (dead)
Docs: man:netctl.profile(5)
Feb 23 14:46:51 dahlia systemd[1]: Dependency failed for A basic static
ethernet connection.
Feb 23 15:23:13 dahlia systemd[1]: Dependency failed for A basic static
ethernet connection.
Feb 23 15:26:28 dahlia systemd[1]: Dependency failed for A basic static
ethernet connection.
I was thinking too using the new systemd-network facility, but it is too
new for me, and if the host is running systemd-git, the container is with
systemd 208.
I would appreciate some help to set up a static Ip on the container
different from the host IP.
Thank you
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140223/06abe354/attachment.html>
More information about the systemd-devel
mailing list