Re: Configure static IP address in F32 container

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/8/20 10:35 AM, Michael Eager wrote:
I'm having a difficult time configuring the IP address of an interface in a Fedora 32 in a LXD container.

The configuration for eth0 in /etc/sysconfig/network-scripts/:
# cat ifcfg-eth0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.20.43
PREFIX=24
GATEWAY=192.168.20.1
IPV6_DISABLED=yes
DNS1=192.168.20.1
DNS2=75.75.75.75
DNS3=8.8.8.8
HWADDR=00:16:3e:d1:ea:86

When I start the container, eth0 gets two IP addresses.  One is the IP specified in the ifcfg-eth0 file.  The other is a DHCP address.  I'm assuming that NetworkManager is getting the DHCP address.

I found the culprit that is getting a DHCP IP address: systemd-networkd.

There are two competing processes managing networks: NetworkManager and Systemd. Feh!

I removed the ifcfg in /etc/sysconfig/network-scripts/ and put the following in /etc/systemd/network/:

# cat eth0.network
[Match]
Name=eth0

[Network]
LinkLocalAddressing=ipv4
Address=192.168.20.43/24
Gateway=192.168.20.1
DNS=192.168.20.1
DNS=75.75.75.75
DNS=8.8.8.8
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux