LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   interface name is different (https://www.linuxquestions.org/questions/linux-newbie-8/interface-name-is-different-4175626874/)

techie123 04-02-2018 04:55 PM

interface name is different
 
i tried creating a ova file for cent os 7 and deploy it in Vmware fusion. the ifconfig -a and /etc/sysconfig/network-scripts/ifcfg-enxXX are showing different interface name.

Kindly help me this.

scasey 04-02-2018 05:00 PM

Please show us what each is showing...

techie123 04-03-2018 12:12 AM

# ifconfig -a
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.234.48.9 netmask 255.255.255.0 broadcast 10.234.48.255
inet6 fe80::250:56ff:feae:d263 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:ae:d2:63 txqueuelen 1000 (Ethernet)
RX packets 40937 bytes 5741443 (5.4 MiB)
RX errors 0 dropped 151 overruns 0 frame 0
TX packets 10478 bytes 756552 (738.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

and the file name in /etc/sysconfig/network-config/ifcfg-ens33

jefro 04-03-2018 02:20 PM

What the boot up sees and what you wrote are two different things. Not sure what the most easy way could be but when you transport Fedora/RH/Centos between machines the network naming is usually changed.
You could either fix the name to match predictive naming or go back to generic naming of eth0 deal maybe.

I'd guess there are ways to automate it upon moves and clones. Even cloning between exactly the same systems causes this issue.

scasey 04-03-2018 03:41 PM

When I migrated from CentOS 5.11 to CentOS 7.4, I opted to copy over the files in /etc/sysconfig/network-scripts/, which used the eth0* naming.
I don't see a /etc/sysconfig/network-config/ in the new installation, however. Oh! I see you used /etc/sysconfig/network-scripts/ in your OP, so maybe network-config in #3 is just a typo...

I also built a backup/test server at home that uses the new naming...
Code:

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.55  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::6e62:6dff:fe44:45fa  prefixlen 64  scopeid 0x20<link>
        ether 6c:62:6d:44:45:fa  txqueuelen 1000  (Ethernet)
        RX packets 3813710  bytes 3460838665 (3.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1137660  bytes 128385162 (122.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The filename matches: -rw-------. 1 root root 396 Feb 5 17:03 ifcfg-enp3s0

On that server, I didn't copy the files, so the naming changed, as jefro suggested.

Is the ifcfg-ens33 the only ifcfg* file in /etc/sysconfig/network-scripts/ ? Is there also a file for ifcfg-ens32 ?

I learned recently that all ifcfg files will be loaded at boot, so any saved or backup copies in /etc/sysconfig/network-scripts/ must not start with ifcfg.

Confirm that there is only one ifcfg file in /etc/sysconfig/network-scripts/, and that it has the correct name.

techie123 04-03-2018 04:51 PM

yes I am seeing only one ifcfg-ens33 file . How its is chosing the interface name?

scasey 04-03-2018 05:30 PM

This is a virtual host? You mentioned Vmware fusion.
What is the distro/configuration of the hosting 'puter? (I know very little about virtual machines)

sundialsvcs 04-03-2018 05:34 PM

I believe that one of the startup-routines remaps the names.

In large installations, it turned out to be a problem to simply "sequentially number" the interfaces. The new nomenclature names the interfaces according to where they are, which makes for more consistency across "many systems." (And some shops have racks full of "systems.")

techie123 04-04-2018 06:16 PM

is there any way to fix the name of the interface file in /etc/sysconfig/network-config/ifcfg-ens33 ?

scasey 04-04-2018 06:30 PM

Quote:

Originally Posted by techie123 (Post 5839474)
is there any way to fix the name of the interface file in /etc/sysconfig/network-config/ifcfg-ens33 ?

That's the second time you've mentioned /etc/sysconfig/network-config/ ... on both of my 7.4 servers, the network scripts are in
/etc/sysconfig/network-scripts/ There is no /etc/sysconfig/network-config/ Is that just a typo here? If not, please see what's in the
/etc/sysconfig/network-scripts/ directory.

AFAIK, you can just rename the file. It's not the name of the file that controls what the NIC is called. That's specified on the DEVICE line in the file:
Code:

more /etc/sysconfig/network-scripts/ifcfg-enp3s0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME=enp3s0
UUID=6fa582df-04f1-4c5c-ac8f-c931fc97777c
DEVICE=enp3s0
ONBOOT=yes
IPADDR=192.168.0.55
PREFIX=24
GATEWAY=192.168.0.1
DNS1=68.2.16.30
DNS2=68.6.16.30
DNS3=8.8.8.8
ZONE=public

OH!! That's probably your answer. What is DEVICE set to in your ifcfg-ens33??

techie123 04-04-2018 07:33 PM

Yes sorry that was an typo . Even in the Device name , I am seeing ens33.

service network status

Configured devices:
lo ens33
Currently active devices:
lo ens192

scasey 04-04-2018 07:44 PM

Good...
Again: What is DEVICE set to in your ifcfg-ens33?? The value of DEVICE in the ifcfg-* file is what controls the name of the device as seen with ifconfig or service network status. Try
Code:

more /etc/sysconfig/network-scripts/ifcfg-ens33
Then, if you wish, just change the name of the ifcfg file:
Code:

mv /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens32
The name of the file doesn't matter. You could call it ifcfg-purple. But the convention is to name it the same as the value of DEVICE.

techie123 04-04-2018 07:51 PM

how to get the same name in the Device name ?

[root@splunk-jump ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
DEVICE="ens33"
ONBOOT=yes
BOOTPROTO=static
TYPE=Ethernet
IPADDR=10.234.28.56
NETMASK=255.255.255.0

[root@test ~]# ifconfig -a

ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.234.28.56 netmask 255.255.255.0 broadcast 10.234.28.255
inet6 fe80::250:56ff:feae:600 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:ae:06:00 txqueuelen 1000 (Ethernet)
RX packets 8800712 bytes 9874648658 (9.1 GiB)
RX errors 0 dropped 381 overruns 0 frame 0

techie123 04-04-2018 07:53 PM

my question here is how to get the same interface name in both the Device name and ifconfig output?

scasey 04-04-2018 08:00 PM

OK. Now I'm officially stumped!
I only have two servers to look at. Both show the same names with ifconfig as are specified for DEVICE in the ifcfg-* files.

Your example in your last post shows a still different name (ens192 instead of ens32), so something else is managing that.
Are you using the Network Manager GUI? [I don't...one server is headless, even].

Again, stumped...sorry...


All times are GMT -5. The time now is 03:41 AM.