- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- "ifconfig down" keeping the link state
Operating System - Linux
1822168
Members
3840
Online
109640
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2011 09:53 AM
тАО05-31-2011 09:53 AM
Hi guys
I have written down a bash script in RHEL to find out the switch name and port to which a ethernet interface is plugged. I'm interested even in the unconfigured interfaces, i.e., plugged with NO IP address assigned.
The tcpdump tool is used BUT it does not work when the interface is DOWN ("ifconfig -a" shows it but "ifconfig" doesn't)
The obviuos solution focuses on using the ifconfig command to set the interface UP and set back DOWN later.
The command "ifconfig down" denies any *software* access to the interface (fine!) BUT shuts down the link, i.e., "ethtool" reports no link detected -- I do not want this, I wanto the set back to its previous state.
Is there any way to set DOWN the interface without removing the physical link?
I come from the HP-UX world, where the ifconfig actions "plumb" and "unplumb" would be required in this case... but Linux ifconfig does not offer those actions.
Thanx in advance
P.D: does anyone know the difference of the UP and RUNNING keywords in the ifconfig output?
I have written down a bash script in RHEL to find out the switch name and port to which a ethernet interface is plugged. I'm interested even in the unconfigured interfaces, i.e., plugged with NO IP address assigned.
The tcpdump tool is used BUT it does not work when the interface is DOWN ("ifconfig -a" shows it but "ifconfig" doesn't)
The obviuos solution focuses on using the ifconfig command to set the interface UP and set back DOWN later.
The command "ifconfig down" denies any *software* access to the interface (fine!) BUT shuts down the link, i.e., "ethtool" reports no link detected -- I do not want this, I wanto the set back to its previous state.
Is there any way to set DOWN the interface without removing the physical link?
I come from the HP-UX world, where the ifconfig actions "plumb" and "unplumb" would be required in this case... but Linux ifconfig does not offer those actions.
Thanx in advance
P.D: does anyone know the difference of the UP and RUNNING keywords in the ifconfig output?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2011 03:53 PM
тАО05-31-2011 03:53 PM
Re: "ifconfig down" keeping the link state
there should be startup/shutdown scripts called ifup and ifdown under /etc/sysconfig/network-scripts.
to restart the interface of eth0, you could do
ifdown eth0 followed by ifup eth0
or you can use the ip command, e.g.
ip link set eth0 down
then
ip link set eth0 up
to restart the interface of eth0, you could do
ifdown eth0 followed by ifup eth0
or you can use the ip command, e.g.
ip link set eth0 down
then
ip link set eth0 up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2011 10:09 PM
тАО05-31-2011 10:09 PM
Re: "ifconfig down" keeping the link state
No, there is no script under /etc/sysconfig/network-scripts because that interface has no IP address assigned.
The ip tool works as ifconfig:
# ethtool eth4 | grep 'Link detected:'
Link detected: yes
# ip link set eth4 up
# ip link set eth4 down
# ethtool eth4 | grep 'Link detected:'
Link detected: no
The ip tool works as ifconfig:
# ethtool eth4 | grep 'Link detected:'
Link detected: yes
# ip link set eth4 up
# ip link set eth4 down
# ethtool eth4 | grep 'Link detected:'
Link detected: no
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2011 03:54 AM
тАО06-01-2011 03:54 AM
Solution
In Linux, you can configure a network interface UP without assigning an IP address to it. This stops the TCP/IP driver stack from using the interface, but the physical link will still be active and low-level access (e.g. tcpdump) is possible.
If the interface is DOWN, you can switch it UP without assigning an IP address with a simple command:
ifconfig up
To remove an already-assigned IP address, you can either reset the IP of the interface to 0.0.0.0:
ifconfig 0.0.0.0
Or you can use "ip addr del dev".
The state "UP without an IP address" would be the closest equivalent of HP-UX state "plumbed but not configured".
---------
The UP and RUNNING keywords refer to administrative and operational states, respectively. (In HP-UX, the "administrative state" and "operational state" are viewable with the "lanadmin -g mibstats" command.)
- if the interface has been commanded to activate, the interface will be UP; if not, it will be down (no keyword).
- if the interface is in working order (i.e. any required firmware files are loaded, the interface has been commanded to be UP and it has a valid physical link), the interface will be RUNNING.
The implementation of the RUNNING state varies between different NIC drivers. In general, if a card is UP but not RUNNING, that indicates a problem: the card has been commanded to run, but is unable to do it at the moment.
It is unusual to see an interface that is RUNNING but not UP: that might mean the command to shut down the interface has just been given, but the NIC hardware has not yet completed the shutdown.
MK
If the interface is DOWN, you can switch it UP without assigning an IP address with a simple command:
ifconfig
To remove an already-assigned IP address, you can either reset the IP of the interface to 0.0.0.0:
ifconfig
Or you can use "ip addr del dev
The state "UP without an IP address" would be the closest equivalent of HP-UX state "plumbed but not configured".
---------
The UP and RUNNING keywords refer to administrative and operational states, respectively. (In HP-UX, the "administrative state" and "operational state" are viewable with the "lanadmin -g mibstats
- if the interface has been commanded to activate, the interface will be UP; if not, it will be down (no keyword).
- if the interface is in working order (i.e. any required firmware files are loaded, the interface has been commanded to be UP and it has a valid physical link), the interface will be RUNNING.
The implementation of the RUNNING state varies between different NIC drivers. In general, if a card is UP but not RUNNING, that indicates a problem: the card has been commanded to run, but is unable to do it at the moment.
It is unusual to see an interface that is RUNNING but not UP: that might mean the command to shut down the interface has just been given, but the NIC hardware has not yet completed the shutdown.
MK
MK
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP