LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 04-13-2016, 05:29 AM   #1
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Rep: Reputation: 16
Network interface is not shown in ifconfig command


I have wrote a network config file to bring up the third network controller on a server running Centos-6.1

Code:
$ cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
NETMASK=255.255.240.0
TYPE=Ethernet
HWADDR=00:e0:81:c6:d7:01
IPADDR=172.16.48.70
GATEWAY=172.16.48.1
IPV6INIT=no
ONBOOT=no
USERCTL=no
$ ls /etc/sysconfig/network-scripts/ifcfg*
/etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-eth2
/etc/sysconfig/network-scripts/ifcfg-eth1  /etc/sysconfig/network-scripts/ifcfg-lo

However, the ifconfig command doesn't show eth2

Code:
$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:E0:81:C6:D5:35
          inet addr:10.10.10.1  Bcast:10.10.10.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:81ff:fec6:d535/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21107 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11464 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2243790 (2.1 MiB)  TX bytes:883788 (863.0 KiB)
          Memory:fe8c0000-fe8e0000

eth1      Link encap:Ethernet  HWaddr 00:E0:81:C6:D5:34
          inet addr:172.20.54.10  Bcast:172.20.54.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:81ff:fec6:d534/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10879 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30033 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13811827 (13.1 MiB)  TX bytes:3538307 (3.3 MiB)
          Memory:fe7c0000-fe7e0000

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:23309 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23309 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7275573 (6.9 MiB)  TX bytes:7275573 (6.9 MiB)

vmnet1    Link encap:Ethernet  HWaddr 00:50:56:C0:00:01
          inet addr:192.168.91.1  Bcast:192.168.91.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

vmnet8    Link encap:Ethernet  HWaddr 00:50:56:C0:00:08
          inet addr:172.16.2.1  Bcast:172.16.2.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


You may think that the third network controller is disabled through BIOS, but it is actually there

Code:
$ dmesg | grep -i intel
  Intel GenuineIntel
e1000e: Intel(R) PRO/1000 Network Driver - 1.9.5-k
e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
e1000e 0000:03:00.0: eth0: Intel(R) PRO/1000 Network Connection
igb: Intel(R) Gigabit Ethernet Network Driver - version 3.2.10-k
igb: Copyright (c) 2007-2011 Intel Corporation.
igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
igb 0000:02:00.1: Intel(R) Gigabit Ethernet Network Connection
I even rebooted the machine but still have this problem
 
Old 04-13-2016, 05:55 AM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Use hwinfo or lshw to show us the network hardware, drivers, and network device nodes assigned.

Code:
lshw -class network
You may need to install one of those utilities first.
 
Old 04-13-2016, 06:22 AM   #3
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
Please see the output. Why the first one is disables?

Code:
# lshw -class network
  *-network DISABLED
       description: Ethernet interface
       product: 82574L Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eth2
       version: 00
       serial: 00:e0:81:c6:d7:01
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=1.9.5-k duplex=full firmware=1.8-0 latency=0 link=no multicast=yes port=twisted pair speed=100Mbit/s
       resources: irq:48 memory:fe9e0000-fe9fffff ioport:c800(size=32) memory:fe9dc000-fe9dffff
  *-network:0
       description: Ethernet interface
       product: 82576 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth1
       version: 01
       serial: 00:e0:81:c6:d5:34
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=3.2.10-k duplex=full firmware=1.4-3 ip=172.20.54.10 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
       resources: irq:40 memory:fe7c0000-fe7dffff memory:fe780000-fe79ffff ioport:b400(size=32) memory:fe740000-fe743fff memory:fe720000-fe73ffff(prefetchable) memory:fe700000-fe71ffff memory:fe744000-fe763fff
  *-network:1
       description: Ethernet interface
       product: 82576 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0.1
       bus info: pci@0000:02:00.1
       logical name: eth0
       version: 01
       serial: 00:e0:81:c6:d5:35
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=3.2.10-k duplex=full firmware=1.4-3 ip=10.10.10.1 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:41 memory:fe8c0000-fe8dffff memory:fe880000-fe89ffff ioport:b800(size=32) memory:fe840000-fe843fff memory:fe820000-fe83ffff(prefetchable) memory:fe7a0000-fe7bffff memory:fe7e0000-fe7fffff

Last edited by mahmoodn; 04-13-2016 at 06:24 AM.
 
Old 04-13-2016, 09:32 AM   #4
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
My bad...
I saw that in the ifcfg-eth2 file, there is

Code:
ONBOOT=no
So, I changed it to yes and restarted the network via
Code:
/etc/init.d/network restart
Still eth2 is not shown in the ifconfig. I guess that a reboot will fix it, but want to know is there any on-the-fly method which doesn't require any reboot?
 
Old 04-13-2016, 11:35 AM   #5
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
What does the following command give you:

Code:
ifconfig -a
You will also notice that your ports are running at different speeds.

eth0=1000
eth1=100

Can you post the config file for eth2?

Last edited by lazydog; 04-13-2016 at 11:44 AM.
 
Old 04-13-2016, 12:55 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
@lazydug: Refer to the opening post for that info.

@mahmoodn: Yes, it should take effect next boot.

https://wiki.centos.org/FAQ/CentOS7#...dd5315906fa493

On the fly you should be able to do
Code:
sudo ifup eth2
 
Old 04-13-2016, 01:22 PM   #7
mahmoodn
Member
 
Registered: May 2010
Posts: 427

Original Poster
Rep: Reputation: 16
OK thank you very much ferarri, that command actually activated eth2.

Many thanks.
 
Old 04-13-2016, 01:35 PM   #8
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by ferrari View Post
@lazydug: Refer to the opening post for that info.
Actually no, the first post did not give what I asked for.
That command 'ifconfig' will only give you up interfaces only.
'ifconfig -a' will give you all interface both up and down.

But it is neither here nor there now that the OP has activated his interface.
 
Old 04-13-2016, 05:55 PM   #9
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
The lshw output confirmed the status and node name associated with the hardware.
 
Old 04-13-2016, 05:55 PM   #10
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Quote:
OK thank you very much ferarri, that command actually activated eth2.

Many thanks.
Happy to have been of help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
failed to execute command : ifconfig <interface> create summersgone Linux - Networking 6 05-12-2009 11:04 AM
In FC6 network interface doesn't come up if 'service network restart' command is run rajat Linux - Networking 2 05-02-2007 11:53 PM
Getting IP address for a network interface through the filesystem, not ifconfig nachosmith Linux - Networking 2 02-26-2007 02:55 AM
a down interface is not shown Rajeev Kumar Linux - Security 3 03-28-2006 04:28 PM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 09:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration