[Arm-dev] Problems with eth0 - Re: What is ifcfg-link?

Thu Aug 2 17:40:34 UTC 2018
Robert Moskowitz <rgm at htt-consult.com>

I used the following nmcli commands:

nmcli con delete eth0
nmcli con add type ethernet con-name eth0 ifname eth0 ip4 
192.168.129.11/23 gw4 192.168.129.1
nmcli con mod eth0 ipv4.dns "50.253.254.2 192.168.129.1"
nmcli con mod eth0 mac "02:67:15:00:81:0B"

This created the ifcfg-eth0 file:

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=192.168.129.11
PREFIX=23
GATEWAY=192.168.129.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
# UUID=c05a6a2c-e720-453e-9897-edbc109a9e11
DEVICE=eth0
ONBOOT=yes
DNS1=50.253.254.2
DNS2=192.168.129.1
HWADDR=02:67:15:00:81:0B

I moved the ethernet cable from the vlan I have been testing with that 
has dhcp to the 192.168.129.1 vlan that lacks dhcp and ran:

nmcli con up eth0
Error: Connection activation failed: No suitable device found for this 
connection.

No addresses on eth0

# ip a
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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP 
group default qlen 1000
     link/ether 02:c4:03:82:c1:53 brd ff:ff:ff:ff:ff:ff
     inet6 fe80::ba72:3d43:b97:596c/64 scope link noprefixroute
        valid_lft forever preferred_lft forever

I commented out that UUID line, and still nothing on eth0.

I moved the cable back to the old vlan and eth0 came right up with its 
dhcp address, not the one in ifcfg-eth0.

So, OK, what is going on here?  This worked just fine back in the old 
1611 image.  What is this ifcfg-link file that seems to be controlling 
the ethernet connection?  How do I get things to work using nmcli?

thanks


I rebooted, and still no


On 08/01/2018 02:04 PM, Robert Moskowitz wrote:
> I went looking for /etc/sysconfig/network-scripts/ifcfg-eth0 to set it 
> up for static addressing.
>
> Instead I found ifcfg-link
>
> What is this?
>
> In the past I was usin nmcli:
>
> ifname=eth0
> nmcli con delete $ifname
> nmcli con add type ethernet con-name $ifname ifname $ifname ip4 
> $your_ipv4_address/$your_ipv4_prefix gw4 $your_ipv4_gateway
> nmcli con mod $ifname ipv4.dns "$your_ipv4_dns1 $your_ipv4_dns2"
> # optionally set your MAC address
> # your_mac=
> # nmcli con mod $ifname mac "$your_mac"
> nmcli con up $ifname
>
> (that con add above is line wrapping in this email)
>
> ip a
>
> shows eth0; do I just use my nmcli script as I did for the 1611 image?
>
> thanks
>
>
> _______________________________________________
> Arm-dev mailing list
> Arm-dev at centos.org
> https://lists.centos.org/mailman/listinfo/arm-dev
>