Hello I'm trying to set up a static ip on a minimal install vm with the IP of the vm is
170.20.x.100 but when I configure the
/etc/sysconfig/network-scripts/ifcfg-eth0 file to have an IPADDR of 172.20.x.100 and I restart the network with systemctl I get an error saying "Error, some other host already uses address
172.20.x.100 and when I change the ip to any other value the ip does resolve and it validates I have checked all of the other hosts on my network and none has that ip on any interface.
Although I did find a file on the main host called
/etc/sysconfig/network-scripts/ifcfg-br1 and it does have the ip of 172.20.x.100 in the IPADDR field, but when I do ifconfig on the interface it does not show that ip instead it shows 172.20.x.1 which is the correct address, I'm using my main hosts as the gateway of my network. This is also a cloned VM and I have been encountering several issues before. I couldn't ping my gateway before because the MAC address of the virtual machine and the MAC of ifcfg-eth0 file
were different but I changed it to the MAC Virt-Manager gave me and it worked. Now the only issue is getting my vm to obtain 172.20.x.100 as the ip address. Are you familiar with this issue?
UPDATE It seems like the issue is still the MAC address.
When I issue
arping -c 2 -w 3 -D -I eth0 172.20.x.100 The reply is Unicast reply from 172.20.x.100 from 0.0.0.0 eth0 Unicast reply from 172.20.x.100 [ 52:54:00:D0:5D:3A ]
but when I go ifconfig eth0 on the vm the MAC is
Static configuration of vm
DEVICE=eth0 ONBOOT=yes BOOTPROTO=static NETMASK=255.255.255.0 IPADDR=172.20.x.100 GATEWAY=172.20.x.1 DNS1=172.20.x.1 DNS2=126.96.36.199 HWADDR=52:54:00:4b:c2:30 PEERDNS=yes TYPE=Ethernet IPV6INIT=no
Ifconfig on main host:
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.40.84.195 netmask 255.255.255.0 broadcast 10.40.84.255 inet6 fe80::d4de:7ab0:3cf4:e2ca prefixlen 64 scopeid 0x20<link> ether ec:b1:d7:38:c7:07 txqueuelen 1000 (Ethernet) RX packets 162478 bytes 70643148 (67.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 37498 bytes 6406695 (6.1 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 20 memory 0xef100000-ef120000 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 189 bytes 21522 (21.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 189 bytes 21522 (21.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.51.1 netmask 255.255.255.0 broadcast 192.168.51.255 ether 52:54:00:7b:f7:52 txqueuelen 1000 (Ethernet) RX packets 34 bytes 1948 (1.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 2374 (2.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.20.x.1 netmask 255.255.255.0 broadcast 172.20.x.255 ether 52:54:00:d0:5d:3a txqueuelen 1000 (Ethernet) RX packets 664 bytes 91395 (89.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 397 bytes 493153 (481.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Content of br1:
DEVICE="br1" ONBOOT="yes" TYPE="Bridge" BOOTPROTO="none" IPADDR="172.20.x.100" GATEWAY="172.20.x.1" STP="on" DELAY="0.0"