eth0:0 is configured but not listed in ifconfig output
eth0
and eth0:0
are the same interface. Use eth0:1
for an alias.
Could it be that DEVICE=eth0
should actually be DEVICE=eth0:0
?
Related videos on Youtube
Vladislav Rastrusny
Updated on September 17, 2022Comments
-
Vladislav Rastrusny almost 2 years
I have the following problem:
My server was given two IPs from [b]different[/b] subnets. Now I am trying to configure the system to work properly. I have created
[root@server ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 # Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) HWADDR=00:30:48:DA:B1:0E DEVICE=eth0 BOOTPROTO=none BROADCAST=79.174.69.255 IPADDR=79.174.69.241 NETMASK=255.255.254.0 NETWORK=79.174.68.0 ONBOOT=yes GATEWAY=79.174.68.1 TYPE=Ethernet [root@server ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0 # Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) HWADDR=00:30:48:DA:B1:0E DEVICE=eth0 BOOTPROTO=none BROADCAST=79.174.69.255 IPADDR=79.174.71.74 NETMASK=255.255.255.0 NETWORK=79.174.71.1 ONBOOT=yes GATEWAY=79.174.71.1 TYPE=Ethernet
But both after "service network restart" and after "reboot"
[root@server ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:30:48:DA:B1:0E inet addr:79.174.71.74 Bcast:79.174.71.255 Mask:255.255.255.0 inet6 addr: fe80::230:48ff:feda:b10e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:910284 errors:0 dropped:0 overruns:0 frame:0 TX packets:2924 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:257964879 (246.0 MiB) TX bytes:232450 (227.0 KiB) Memory:df220000-df240000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:27 errors:0 dropped:0 overruns:0 frame:0 TX packets:27 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:6976 (6.8 KiB) TX bytes:6976 (6.8 KiB)
Device eth0:0 is not shown as active. If I try
[root@server ~]# ifconfig eth0:0 eth0:0 Link encap:Ethernet HWaddr 00:30:48:DA:B1:0E UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Memory:df220000-df240000
It is shown as up and running, but IP is not assigned to it.
Also it is strange, that IP address assigned to eth0:0 in config file is used by eth0.
/var/log/messages shows nothing about network configuration errors on either eth0 or eth0:0. system-config-network seem to understand all settings correctly and resaves them ok also.
"ifup eth0:0" executes ok, but ifconfig afterwards shows no eth0:0 device after that.
What did I do wrong? May be the problem is that IPs are from different subnets?
-
rkthkr about 14 yearsWell spotted :)
-
Vladislav Rastrusny about 14 yearsThat is not correct: kbase.redhat.com/faq/docs/DOC-6133 | centos.org/docs/5/html/Deployment_Guide-en-US/… | faqs.org/docs/Linux-mini/IP-Alias.html eth0:0 is a correct alias. My second CentOS server is using it and works ok.
-
Dan Andreatta about 14 years@FractalizeR: I remember I stopped eth0:0 by mistake once and it brought down the whole interface, but it was on Ubuntu. Or I remember wrong. Anyway, I have edited the post with a different attempt.
-
Vladislav Rastrusny about 14 yearsYes, I've just spotted that it should be DEVICE=eth0:0! The problem arose when I misconfigured IPs on network card and asked hoster to correct this problem and to bring up second IP on virtual adapter. My god..
-
Dan Andreatta about 14 years@FractalizeR: Don't be so hard on yourself. I had to drive to the colo place because a server would not come up for a similar misconfiguration... and Ubuntu will fail all interfaces if one is misconfigured...