Hi, I'm trying to install fedora coreos on my server. I do not have a DHCP-server available but used static IP before (project atomic). When booting coreos from USB-stick it is looking for a DHCP-server. When not found it fails. After a while it retries to get an IP-address. I have tried to add a lease command to /etc/dhclient.conf like:
lease { interface "eth0"; fixed-address 192.168.5.50; option subnet-mask 255.255.255.0; option routers 192.168.5.10; option domain-name-servers 192.168.5.10; }
Then I killed the dhclient process and restarted it with same parameters as it was run before: dhclient -4 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.eth0.pid -lf /tmp/dhclient.eth0.lease eth0
But dhclient does not use the static configuration I have made and fails with a message like: Could not find a valid lease.
What am I doing wrong here? Is there an easier way to force a static IP address? Can I stop the boot process and give some commands when loading the kernel?
Any ideas appreciated. Best regards, Jonny
Doug H proposed the following which solved the problem for me:
For one time only command line addition it should look something like this:
Check current state...
[root@localhost ~]# cat /etc/resolv.conf # Generated by NetworkManager
[root@localhost ~]# ip route
[root@localhost ~]# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:ca:d8:42 brd ff:ff:ff:ff:ff:ff [root@localhost ~]#
Use interface "enp0s3"... (The device, network used, ip used and default route must be what would work for your setup)
[root@localhost ~]# echo "nameserver 8.8.8.8" > /etc/resolv.conf
[root@localhost ~]# ip addr add 192.168.1.5/24 dev enp0s3
[root@localhost ~]# route add default gw 192.168.100.254 enp0s3
Verify...
[root@localhost ~]# ping -c2 google.com PING google.com (172.217.14.206) 56(84) bytes of data. 64 bytes from sea30s01-in-f14.1e100.net (172.217.14.206): icmp_seq=1 ttl=55 time=38.0 ms 64 bytes from sea30s01-in-f14.1e100.net (172.217.14.206): icmp_seq=2 ttl=55 time=38.7 ms
--- google.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 38.019/38.379/38.740/0.360 ms [root@localhost ~]#