Red Hat Disable a NIC permanently..


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Red Hat Disable a NIC permanently..
# 1  
Old 08-06-2015
Network Red Hat Disable a NIC permanently..

Hi,

I have a task here where I need to write a script to disable one of my NIC when it checks certain event. Till now I am not able to find a way to do this, because, it should be persistent though restart of services as well as reboots.
I have tested putting it in rc.local, but it doesn't work.

Any help!
# 2  
Old 08-06-2015
Maybe if you told us your operating system that'd help narrow down the possible solutions a bit.
# 3  
Old 08-06-2015
Exactly what UNIX or Linux are you using?

I am guessing you want to take the NIC offline, nothing more.

This seems to be a rather "overkill" approach. What are you trying to accomplish?

In other words this seems a really odd approach. There may be something much simpler and probably safer to implement.
# 4  
Old 08-06-2015
If the device uses a unique driver, you can blacklist the driver.

If not, then you can likely modify udev to (perhaps) get what you want.

See: https://projectgus.com/2014/09/black...ce-from-linux/

(that example isn't for a NIC but you might be able to adapt it, you just have to be able to identify the device)
# 5  
Old 08-06-2015
Sorry for the delay, this is for RHEL 6.6, we want to suppress card for non DB machines, but can do it after building only. I don't want to do misconfiguration in ifcfg-eth* files. Any alternative approach would be better.
# 6  
Old 08-06-2015
What do you mean by "misconfiguration"?

When does this need to take effect?

If boot time is good enough, udev may be a way to go, it can rename the device into something which does not match the entries in your network configuration. Make sure the network config is set to not automatically do DHCP on unknown devices.
# 7  
Old 08-06-2015
Misconfiguration here, can look like: if I want to disable eth1 card, then I can empty ifcfg-eth1 file, and just keep DEVICE=eth1, and then restart Network services.

Quote:
Originally Posted by Corona688
What do you mean by "misconfiguration"?

When does this need to take effect?

If boot time is good enough, udev may be a way to go, it can rename the device into something which does not match the entries in your network configuration. Make sure the network config is set to not automatically do DHCP on unknown devices.

Last edited by rbatte1; 08-07-2015 at 05:52 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to know if i use "Red Hat Enterprise Linux" or "Red Hat Desktop" ?

how to know if i use "Red Hat Enterprise Linux" or "Red Hat Desktop" ? (2 Replies)
Discussion started by: ahmedamer12
2 Replies

2. Linux

'route get' for Red Hat

Hi everyone, I've always used the 'route get hostname/ip' function in Solaris to test whether routing is setup correctly for particular hosts. The 'get' switch doesn't seem to be available for Red Hat. Can anyone offer a suitable alternative? Many thanks. ---------- Post updated at... (0 Replies)
Discussion started by: badoshi
0 Replies

3. Red Hat

Red-hat

Hello, How do I see what IP addresses are connected to my machine? thanks (2 Replies)
Discussion started by: sonomao
2 Replies

4. Red Hat

Red Hat E 3

I'm am working with a Red Hat Enterprise 3 server. This is a dedicated server that is supposedly dedicated to one domain, but I have been tasked with trying to figure out if there are files on this system that are being accessed by other IP's. Does anyone know if how I would go about finding... (0 Replies)
Discussion started by: chrisPlusPlus
0 Replies

5. Linux

red hat ee 2.6.9-42

hello. I would be greatfull if someone could tell me how will i see what dns server and gateway my red hat server uses. I tryied to find out by typing ifconfig command but i got : -bash: ifconfig: command not found , although man ifonconfig gives output with info about using that command. Is... (3 Replies)
Discussion started by: tonijel
3 Replies

6. UNIX for Dummies Questions & Answers

Red Hat 9 help

please help me how to install softwares in linux.i have a ethernet internet connection.i try to open the site on LAN to download internet client.but i cannot as our lan supports only internet explorer....i downloaded the linux client by booting thru XP......but i cannot c my NTFS partition thru... (0 Replies)
Discussion started by: shobhit143
0 Replies

7. Linux

Red Hat?

I have a Red Hat upgrade disk. I installed it and it corrupted my entire hard drive! I had gotten the disks out of a Dummy's book at my local library. Trying to install 'Red Hat', has cost me $100.00 in damages. (The cool part is my friend gave me that $100.00 part) Ah...A 120gig Hard Drive. Just... (3 Replies)
Discussion started by: hdk_mkr
3 Replies

8. Linux

Red Hat 7.3 and Win XP

People, im having trouble installing red hat and win xp in the same machine, it just won`t create the double boot. Can anybody give me a hand? Im installing win xp in C and red hat in D. I´ve selected both grub and lilo as loaders in the mbr of hda0, but when i do this, mi original xp just... (5 Replies)
Discussion started by: mat
5 Replies

9. UNIX for Dummies Questions & Answers

Red Hat 7.2.....

I just installed red hat 7.2 on my laptop. it's dual booted with xp and red hat. when i boot in to linux it boots up to the screen to ask me my name and pass....i put in root and my password. after this it goes to a blue screen and sits there. the after about 2 minutes it comes up with a fatal... (1 Reply)
Discussion started by: muzscman
1 Replies
Login or Register to Ask a Question