[systemd-devel] Basic network with Fedora conatiner
arnaud gaboury
arnaud.gaboury at gmail.com
Wed Apr 29 08:22:26 PDT 2015
On Wed, Apr 29, 2015 at 4:48 PM, Dan Williams <dcbw at redhat.com> wrote:
>
> On Wed, 2015-04-29 at 15:36 +0200, arnaud gaboury wrote:
> > After installation of Fedora 22 container, the container (poppy) boots
> > but no network.
> >
> > # journalctl -b -M poppy
> > ................
> >
> > Apr 29 14:02:20 poppy firewalld[28]: 2015-04-29 14:02:20 ERROR:
> > ebtables not usable, disabling ethernet bridge firewall.
> > Apr 29 14:02:20 poppy NetworkManager[56]: <warn> Could not get
> > hostname: failed to read /etc/sysconfig/network
> > Apr 29 14:02:20 poppy NetworkManager[56]: <info> Acquired D-Bus
> > service com.redhat.ifcfgrh1
> >
> > On host:
> >
> > -------------------------------------------------------------------
> > $ ip a
> > 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
> > group default
> > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> > inet 127.0.0.1/8 scope host lo
> > valid_lft forever preferred_lft forever
> > inet6 ::1/128 scope host
> > valid_lft forever preferred_lft forever
> > 2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> > master br0 state UP group default qlen 1000
> > link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff
> > inet6 fe80::16da:e9ff:feb5:7a88/64 scope link
> > valid_lft forever preferred_lft forever
> > 3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
> > UP group default
> > link/ether b6:0c:00:22:f1:4a brd ff:ff:ff:ff:ff:ff
> > inet 192.168.1.87/24 brd 192.168.1.255 scope global br0
> > valid_lft forever preferred_lft forever
> > inet6 fe80::b40c:ff:fe22:f14a/64 scope link
> > valid_lft forever preferred_lft forever
> > 6: ve-poppy: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
> > group default qlen 1000
> > link/ether 0e:9a:d7:18:a3:59 brd ff:ff:ff:ff:ff:ff
> >
> > % systemctl status systemd-networkd
> > ● systemd-networkd.service - Network Service
> > Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service;
> > enabled; vendor preset: enabled)
> > Active: inactive (dead) since Wed 2015-04-29 13:36:28 CEST; 32min ago
> > Docs: man:systemd-networkd.service(8)
> > Main PID: 493 (code=exited, status=0/SUCCESS)
> > Status: "Shutting down..."
> >
> > Apr 29 13:35:40 hortensia systemd[1]: Starting Network Service...
> > Apr 29 13:35:40 hortensia systemd-networkd[493]: br0 : netdev ready
> > Apr 29 13:35:40 hortensia systemd-networkd[493]: Enumeration completed
> > Apr 29 13:35:40 hortensia systemd[1]: Started Network Service.
> > Apr 29 13:35:40 hortensia systemd-networkd[493]: enp7s0 :
> > link configured
> > Apr 29 13:35:40 hortensia systemd-networkd[493]: br0 :
> > link configured
> > Apr 29 13:35:42 hortensia systemd-networkd[493]: enp7s0 :
> > gained carrier
> > Apr 29 13:35:42 hortensia systemd-networkd[493]: br0 :
> > gained carrier
> >
> >
> > -------------------------------------------------------------------------------
> >
> > on container:
> >
> > $ ip a
> > 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
> > group default
> > link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> > inet 127.0.0.1/8 scope host lo
> > valid_lft forever preferred_lft forever
> > inet6 ::1/128 scope host
> > valid_lft forever preferred_lft forever
> > 2: host0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
> > default qlen 1000
> > link/ether 0e:7f:c3:fb:25:b1 brd ff:ff:ff:ff:ff:ff
> >
> > $ systemctl status systemd-networkd
> > ● systemd-networkd.service - Network Service
> > Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service;
> > disabled; vendor preset: disabled)
> > Active: inactive (dead)
> > Docs: man:systemd-networkd.service(8)
> > ---------------------------------------------------------------------------
> >
> > My guess is that I need to get rid of Networkmanager on Fedora
> > container and instead use systemd-networkd. Am I right ?
>
> NM shouldn't be messing with the networking that anything else outside
> of NM sets up. It will co-exist and leave whatever else is managing the
> container network alone (eg, systemd-networkd). I think we'd need more
> logs from systemd-networkd and NetworkManager to figure out what's going
> on, plus the .network and .link files that you've created for
> systemd-networkd.
>
1- I have some old configs from a previous Arch container with a
static IP. I need to clean
for example,
------------------------------------------------------------------
gabx at hortensia ➤➤ zsh/zshrc.d % ls -al /etc/systemd/network/
total 20K
drwxr-xr-x 2 root root 4.0K Jun 9 2014 ./
drwxr-xr-x 5 root root 4.0K Apr 27 08:15 ../
lrwxrwxrwx 1 root root 9 Jun 9 2014 80-container-host0.network -> /dev/null
-rw-r--r-- 1 root root 59 Mar 19 2014 bridge.netdev
-rw-r--r-- 1 root root 112 Mar 19 2014 bridge.network
-rw-r--r-- 1 root root 42 Mar 19 2014 eth.network
--------------------------------------------------------------------------------
I removed the custom link to /dev/null
2- I run a custom kernel and need to check everything about iptables
and netfilters are OK.
>From host:
------------------------------------------------------------------------------------------
gabx at hortensia ➤➤ zsh/zshrc.d % sudo systemctl status
systemd-networkd -l
[sudo] password for root:
● systemd-networkd.service - Network Service
Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service;
enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2015-04-29 17:13:14 CEST; 6min ago
Docs: man:systemd-networkd.service(8)
Process: 18762 ExecStart=/usr/lib/systemd/systemd-networkd
(code=exited, status=0/SUCCESS)
Main PID: 18762 (code=exited, status=0/SUCCESS)
Status: "Shutting down..."
Apr 29 17:12:05 hortensia systemd[1]: Starting Network Service...
Apr 29 17:12:05 hortensia systemd-networkd[18762]: br0 :
netdev ready
Apr 29 17:12:05 hortensia systemd-networkd[18762]: Enumeration completed
Apr 29 17:12:05 hortensia systemd[1]: Started Network Service.
Apr 29 17:12:05 hortensia systemd-networkd[18762]: ve-poppy :
Could not enable IP masquerading: No such file or directory
Apr 29 17:12:05 hortensia systemd-networkd[18762]: ve-poppy :
Could not enable IP masquerading: No such file or directory
-------------------------------------------------------------------------------------------------------------------------------
> Dan
>
--
google.com/+arnaudgabourygabx
More information about the systemd-devel
mailing list