5

my ifcfg-eth1 config as below

DEVICE=eth1
TYPE=Ethernet
UUID=5e4f36f8-14eb-4f0c-8fa9-3af9be3899a7
ONBOOT=no
NM_CONTROLLED=yes
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
HWADDR=00:0C:29:8A:A5:67
PEERDNS=yes
PEERROUTES=yes

q1) what does ONBOOT do ? I have set it to NO but i still see the interface when i do a IFCONFIG

[oracle@SJOAM network-scripts]$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:0C:29:8A:A5:5D  
          inet addr:192.168.1.25  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe8a:a55d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:61 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13496 (13.1 KiB)  TX bytes:2231 (2.1 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:8A:A5:67  
          inet6 addr: fe80::20c:29ff:fe8a:a567/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2412 (2.3 KiB)  TX bytes:258 (258.0 b)

It is the same when i issue ifdown eth1, ifconfig still show eth1.

It is only when i issue ifconfig eth1 stop, then eth1 is totally remove from ifconfig.

q2) What is the difference between ONBOOT=no, ifdown eth1 and ifconfig eth1 down ?

dawud
  • 14,918
  • 3
  • 41
  • 61
Noob
  • 363
  • 2
  • 6
  • 16
  • 1
    because NM_CONTROLLED=yes(network manager). – c4f4t0r Jul 06 '15 at 13:00
  • what does NM_CONTROLLED does ? how does it affect ONBOOT ? – Noob Jul 06 '15 at 13:09
  • I think is a good idea if you start reading https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-Network_Interfaces.html – c4f4t0r Jul 06 '15 at 13:25
  • @c4f4t0r thanks for the link, i removed NM_CONTROLLED from the config, and do a reboot. But i stlil see the interface when i do a ifconfig, ONBOOT=no already. Only if i do a ifconfig eth1 down, then ifconfig will not show the interface completely. what is the difference between ONBOOT=no and ifconfig eth1 down ? – Noob Jul 06 '15 at 13:43
  • @c4f4t0r update, if i chkconfig NetworkManager Off, yes. i no longer see the interface. anymore after reboot.. what actually does NetworkManager do ?.. – Noob Jul 06 '15 at 13:56
  • try to use rpm -qi NetworkManager – c4f4t0r Jul 06 '15 at 14:33
  • @c4f4t0r saw the info. But still doesn't understand the need to have it. my interface still stay up after reboot when onboot=yes , How does it keep eth1 showing in ifconfig and not having ip (when dhcp=auto) is unknown to me as well – Noob Jul 09 '15 at 16:05
  • if your interface is controlled by networkmanager and you have onboot=no and bootproto=dhcp the interface will get ip address when networkmanager start or you login in your desktop, but if you want to have eth1 up without an ip, you need to use onboot=yes and bootproto=none, why you want to active eth1 with dhcp on boot and you have eth0, sorry but I don't know what you want to archive. – c4f4t0r Jul 09 '15 at 16:21
  • @c4f4t0r does networkmanager ignores onboot=no ? i am just curious why eth1 stay up when onboot=no and i have to ifconfig eth1 down to remove it. ifdown doesn't help either. – Noob Jul 09 '15 at 16:24
  • I'm not sure, but I don't think networmanager care about onboot=no, because in my PC network always try to manager all physical and virtual interfaces – c4f4t0r Jul 09 '15 at 16:35

1 Answers1

0

When you ifdown an interface it should become unconfigured, but it does not cease to exist. It will still show up in ifconfig or ip link because the physical port exists and Linux has loaded a driver for it. The eth* provides a handle to refer to so that it can be configured. If you want the device to completely go away you would need to disable the driver which is more trouble than it is worth for most cases like this.

chicks
  • 3,639
  • 10
  • 26
  • 36