{"id":4542,"date":"2013-03-21T23:07:18","date_gmt":"2013-03-21T15:07:18","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=4542"},"modified":"2023-04-28T09:48:22","modified_gmt":"2023-04-28T09:48:22","slug":"how-to-add-network-adapter-without-reboot-on-centos-6rhel-6","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-add-network-adapter-without-reboot-on-centos-6rhel-6\/","title":{"rendered":"How to Add Network Adapter Without Reboot on CentOS 6\/RHEL 6"},"content":{"rendered":"<p>This article will explain how to prepare more than one network interface on a VMware virtual machine (VM) without reboot the linux server. Normally, a network interface is sufficient to run a linux server. To ensure a balance of traffic or to enable multiple network segments in a VM, it is advisable to install more than one interface card. It was assumed that the card eth0 is configured properly and working. The process of adding a second network interface card is very easy in VMware ESXi \/ ESX and VMware workstation. What you need is through the vCenter or ESXi host, start the add hardware wizard and then select &#8220;Network Adapter&#8221; and let the wizard complete successfully. The following are the tested steps on CentOS 6.4 and may be applied on CentOS 6.5 and CentOS 6.6 operating system.<\/p>\n<p>1. Check existing network setting.<\/p>\n<pre>\n[root@centos64 ~]# ifconfig\neth0      Link encap:Ethernet  HWaddr 00:0C:29:F1:24:F0\n          inet addr:192.168.2.62  Bcast:192.168.255.255  Mask:255.255.0.0\n          inet6 addr: fe80::20c:29ff:fef1:24f0\/64 Scope:Link\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\n          RX packets:735 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:81 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:1000\n          RX bytes:72242 (70.5 KiB)  TX bytes:8635 (8.4 KiB)\n\nlo        Link encap:Local Loopback\n          inet addr:127.0.0.1  Mask:255.0.0.0\n          inet6 addr: ::1\/128 Scope:Host\n          UP LOOPBACK RUNNING  MTU:16436  Metric:1\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:0\n          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)\n<\/pre>\n<p>2. Enter network configuration folder, and look for ethx file. By default, first network interface will start with eth0. Next added network adapter will be eth1.<\/p>\n<pre>\n[root@centos64 ~]# cd \/etc\/sysconfig\/network-scripts\/\n[root@centos64 network-scripts]# ls\nifcfg-eth0   ifdown-ippp  ifdown-routes  ifup-bnep  ifup-plip    ifup-sit          network-functions\nifcfg-lo     ifdown-ipv6  ifdown-sit     ifup-eth   ifup-plusb   ifup-tunnel       network-functions-ipv6\nifdown       ifdown-isdn  ifdown-tunnel  ifup-ippp  ifup-post    ifup-wireless\nifdown-bnep  ifdown-post  ifup           ifup-ipv6  ifup-ppp     init.ipv6-global\nifdown-eth   ifdown-ppp   ifup-aliases   ifup-isdn  ifup-routes  net.hotplug\n<\/pre>\n<p>3. After you add secondary network interface from VMware level, the file will automatically added the mac address in \/etc\/udev\/rules.d\/70-persistent-net.rules. Please take note on the mac address for eth1.<\/p>\n<pre>\n[root@centos64 ~]# more \/etc\/udev\/rules.d\/70-persistent-net.rules\n# This file was automatically generated by the \/lib\/udev\/write_net_rules\n# program, run by the persistent-net-generator.rules rules file.\n#\n# You can modify it, as long as you keep each rule on a single\n# line, and change only the value of the NAME= key.\n\n# PCI device 0x8086:0x100f (e1000)\nSUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"00:0c:29:f1:24:f0\", ATTR{type}==\"1\", KERNEL==\"\neth*\", NAME=\"eth0\"\n\n# PCI device 0x8086:0x100f (e1000)\nSUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"00:0c:29:f1:24:fa\", ATTR{type}==\"1\", KERNEL==\"\neth*\", NAME=\"eth1\"\n<\/pre>\n<p>4. Now you need to create the configuration file for your new interface. The network interface configuration files are placed in \/etc\/sysconfig\/network-scripts\/. change the mac address according based on \/etc\/udev\/rules.d\/70-persistent-net.rules.<\/p>\n<pre>\n[root@centos64 ~]# vi \/etc\/sysconfig\/network-scripts\/ifcfg-eth1\n<\/pre>\n<p>Add below setting :<\/p>\n<pre>\nDEVICE=eth1\nHWADDR=00:0c:29:f1:24:fa\nTYPE=Ethernet\nONBOOT=yes\nNM_CONTROLLED=yes\nBOOTPROTO=none\nIPADDR=192.168.2.63\nNETMASK=255.255.0.0\n<\/pre>\n<p>5. Based on the type interface being added, issue an ifup command. In this case, we have added eth1.<\/p>\n<pre>\n[root@centos64 ~]# ifup eth1\n<\/pre>\n<p>6. Verify new Network interfaces :<\/p>\n<pre>\n[root@centos64 ~]# ifconfig eth0\neth0      Link encap:Ethernet  HWaddr 00:0C:29:F1:24:F0\n          inet addr:192.168.2.62  Bcast:192.168.255.255  Mask:255.255.0.0\n          inet6 addr: fe80::20c:29ff:fef1:24f0\/64 Scope:Link\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\n          RX packets:8019 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:6949 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:1000\n          RX bytes:804606 (785.7 KiB)  TX bytes:694075 (677.8 KiB)\n\n[root@centos64 ~]# ifconfig eth1\neth1      Link encap:Ethernet  HWaddr 00:0C:29:F1:24:FA\n          inet addr:192.168.2.63  Bcast:192.168.255.255  Mask:255.255.0.0\n          inet6 addr: fe80::20c:29ff:fef1:24fa\/64 Scope:Link\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\n          RX packets:450 errors:0 dropped:0 overruns:0 frame:0\n          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0\n          collisions:0 txqueuelen:1000\n          RX bytes:40087 (39.1 KiB)  TX bytes:1182 (1.1 KiB)\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This article will explain how to prepare more than one network interface on a VMware virtual machine (VM) without reboot the linux server. Normally, a network interface is sufficient to&#8230;<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,2058],"tags":[1244,1536,1715],"class_list":["post-4542","post","type-post","status-publish","format-standard","hentry","category-centos","category-rhel","tag-centos","tag-linux","tag-rhel-6"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=4542"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/4542\/revisions"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=4542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=4542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=4542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}