- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: RHEL5 need to re-ordering network interfaces
Categories
Company
Local Language
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
Discussions
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
Community
Resources
Forums
Blogs
- 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
09-10-2009 07:56 AM
09-10-2009 07:56 AM
RHEL5 need to re-ordering network interfaces
My system install with RHEL5 and I have
eth0 to eth5
when I ran command
#ip addr
the list shown like :
eth2
eth4
eth0
eth5
eth3
eth1
The question is
How I manipulate this order. I need eth5 to be the first by this command
Note : "ip addr" will show the list of interface with ip , ordering by ifindex, how can i tell kernel to remember the sequence that I really need ?
Thx in advanced for any expert here :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2009 10:08 AM
09-10-2009 10:08 AM
Re: RHEL5 need to re-ordering network interfaces
My question is, "Why do you care?".
man sort
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2009 10:17 AM
09-10-2009 10:17 AM
Re: RHEL5 need to re-ordering network interfaces
However, if you need the information of eth5 in particular, why don't you say so to the system?
ip addr show dev eth5
This command will show you the information of eth5 *only*.
If you want to list all the interfaces in some particular order, you could do something like this:
for i in eth0 eth1 eth2 eth3 eth4 eth5
do
ip addr show dev $i
done
This script would output a listing similar to "ip addr", but ordered exactly as specified in the "for iface in..." line.
If you need to pipe the custom-ordered list into something, you need to either save the ordered-list routine into a separate script file, or put parentheses ( ) around the entire routine before the redirection, like this:
( for i in eth5 eth4 eth3 eth2 eth1 eth0
do
ip addr show dev $i
done ) | somecommand
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2009 04:49 PM
09-10-2009 04:49 PM
Re: RHEL5 need to re-ordering network interfaces
I have snmpd install on this system and send the trap to SIM server through eth5.
when the trap send the source ip is the eth5 ip address , yes that correct but I sniff the packet and look into the snmp PDU, I found the agentaddress field is not the eth5 ip address but it is the ip address of the eth2.
I try to change many of snmpd.conf to fix the agentaddress but not work.
So, I realize the fact that snmpd will use first ip address list by "ip addr" command encap into the trap PDU.
So, I change my strategy to re-order the list of ifindex ,but it seem I am going to the kernel mazed. Fortunately, I found this forum that may be helpfull for me so I come and post.
Anyway, thx for all of you to posting any comment for my problem.
Today, I gonna to fix this problem by new strategy.
by disable the NIC card that is not belong to eth5 . I think may be the kernel will remember the new order.
B/r
:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2009 11:17 PM
09-10-2009 11:17 PM
Re: RHEL5 need to re-ordering network interfaces
If it's the IP address of eth2, then this may be the procedure snmpd uses to find the agentaddress. In other words, the agentaddress would be the IP address associated with the fully-qualified hostname.
If this is true, it might be helpful to make sure that the IP address of eth5 is associated with the hostname in /etc/hosts file. If there are any other lines listing the hostname in /etc/hosts, re-order them so that the line with the IP address of eth5 is the first of them.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2009 12:10 AM
09-11-2009 12:10 AM
Re: RHEL5 need to re-ordering network interfaces
then add the eth5 ip address at the first line in /etc/hosts
service network restart
then send snmp trap
#!/bin/sh
snmptrap -v 1 -c public 10.235.35.220 enterprises.232 '' 6 11003 '' system.5.0 s `cat /proc/sys/kernel/hostname` enterprises.232.11.2.11.1 i 0 enterprises.232.11.2.8.1 s 'Test Trap'
but result still the same
:(