Sponsored Content
Top Forums Shell Programming and Scripting dhcpclient for all the eth* which has no ip Post 302700399 by yanglei_fage on Thursday 13th of September 2012 10:47:12 AM
Old 09-13-2012
Quote:
Originally Posted by Ygor
Try using something like...
Code:
$ cat file1
eth0      Link encap:Ethernet  HWaddr 00:1E:67:3E:BA:EF
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Memory:d1900000-d1920000
 
eth1      Link encap:Ethernet  HWaddr 00:1B:21:3F:BF:28
          inet addr:192.85.1.1  Bcast:192.85.255.255  Mask:255.255.0.0
          inet6 addr: fe80::21b:21ff:fe3f:bf28/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:5126 (5.0 KiB)
 
eth2      Link encap:Ethernet  HWaddr 00:1E:67:3E:BA:EE
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Memory:d1920000-d1940000
 
$ awk '/^eth/{e[++c]=$1}/inet addr/{a[c]=$2}END{for(i=1;i<=c;i++)if(!a[i])print e[i]}' file1
eth0
eth2
 
$


Hi thanks for the help, this is the first time I see this awk usage
'/**/***/***/'
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Eth err: "3c501 device eth0 does not seem to be present"

HI, When I do 'service network restart' , I am getting the following error. "3c501 device eth0 does not seem to be present, delaying initialization" Can any one suggest me the cause/solution for this? When I do 'lspci' it is showing the ehternet card as " Ethernet controller"Marvell... (2 Replies)
Discussion started by: praveen_b744
2 Replies

2. Linux

Renaming eth interfaces

Hi I had a DL380 with two two port eth cards. I now replaced one with a four port eth card and my interfaces seemed to have jumped around. Is there a method of moving eth ports... eg making port eth4 eth2.:confused: (2 Replies)
Discussion started by: theroncj
2 Replies

3. UNIX for Dummies Questions & Answers

NIC and eth connection

folks; This might sounds stupid but i hope someone can give me an answer: On my Linux SUSE boxes, i have 2 NIC cards NIC1 & NIC2. I always assumed that NIC1 is eth0 when i run "ifconfig" and NIC2 is eth1 but i noticed that's not always the case. Is there a way or a command i can run to find... (1 Reply)
Discussion started by: Katkota
1 Replies

4. IP Networking

Socket and interface (eth0, eth 1)relationship

hi, Could some one answer this please we have a program with client socket declared which connect to a server for the above program description we wont send an interface information ... let us suppose, I have two interfaces (eth0 , eth1) which are assigned some ip, which interface the... (1 Reply)
Discussion started by: Gopi Krishna P
1 Replies

5. IP Networking

Eth interfaces UP but NOT RUNNING

Hi people, I have a solaris OS system. I configured its interfaces. They are UP but not in RUNNING status except loopback interface. I made the interfaces DOWN and UP again. The other side of the interfaces (switch ports) are UP. Does anyone have any idea? What may cause this problem, How can I... (1 Reply)
Discussion started by: hubatuwang
1 Replies

6. Red Hat

Find out which eth or device belongs to interface "port 1 PCI 4"

Hi, I´ve given only this info to configure a network interface : "port 1 PCI 4" I´ve been searching for any kind of relationship in the system which allow me to find the etc that must be configured... Please, could anybody help me? rhxx:#/root# lspci |grep -i "PCI BRIDGE" 00:01.0 PCI... (0 Replies)
Discussion started by: pabloli150
0 Replies

7. UNIX for Dummies Questions & Answers

Traffic moves to another eth

hi guys I have a server which has 2 nics eth0 and eth1 eth0 is used for our email traffic server. everything working fine some time later a eth1 was added for backup purposes so this new nic sends data to another vlan for backup purposes all of a sudden our mail server starts to fail... (3 Replies)
Discussion started by: karlochacon
3 Replies

8. Red Hat

ifconfig eth - errors after certain packets received

Hi, I am facing an issue with one of the 10G fiber link. After certain packets received. I am seeing errors in ifconfig eth* output. MTU is set to 9000. any idea? (1 Reply)
Discussion started by: snchaudhari2
1 Replies

9. UNIX for Advanced & Expert Users

RedHat eth interfaces not seem to be present

Dear community, I'm in trouble with Red Hat Server 5.8. After rebooting the server, I loose two interfaces used for bond2 (eth4 and eth5). I reboot twice the server but the result is always: # service network restart Shutting down interface bond0: Shutting down... (1 Reply)
Discussion started by: Lord Spectre
1 Replies
SMC91C92_CS(4)						     Kernel Interfaces Manual						    SMC91C92_CS(4)

NAME
smc91c92_cs - SMC 91cxx device driver SYNOPSIS
insmod smc91c92_cs.o [pc_debug=n] [if_port=n] [irq_list=i,j,...] DESCRIPTION
Smc91c92_cs is the low-level Card Services driver for SMC 91c92, 91c94, 91c96, and 91c100 based PC Card ethernet adapters. When this driver is attached to a card, it allocates the next available ethernet device (eth0..eth#). This device name will be reported in the ker- nel log file, and passed on to cardmgr(8). With the default transceiver setting, the driver will attempt to continuously autodetect the transceiver type (10base2 or 10baseT). There should normally only be a one or two second lag before the correct transceiver is selected. On particularly noisy or busy networks, it is possible for the detection logic to incorrectly toggle the transceiver type. If this becomes a problem, it may be necessary to explicitly select the interface type when the module is loaded or with the ifport command. PARAMETERS
pc_debug=n Selects the PCMCIA debugging level. This parameter is only available if the module is compiled with debugging enabled. A non-zero value enables debugging. if_port=n Selects the transceiver type. 0 is autodetect (10baseT or 10base2), 1 is 10baseT (twisted pair), and 2 is 10base2 (BNC, or thin net). The default is 0 (autodetect). irq_list=i,j,... Specifies the set of interrupts that may be allocated by this driver. DIAGNOSTICS
eth#: interrupt(s) dropped! Indicates that the driver did not receive an interrupt notification for some reason. The driver will poll the card (with a signifi- cant performance penalty) if the problem persists. The most likely cause is an interrupt conflict and/or host bridge configuration problem. DIAGNOSTICS
eth#: interrupt(s) dropped! Indicates that the driver did not receive an interrupt notification for some reason. The driver will poll the card (with a signifi- cant performance penalty) if the problem persists. The most likely cause is an interrupt conflict and/or host bridge configuration problem. AUTHOR
David Hinds - dahinds@users.sourceforge.net SEE ALSO
cardmgr(8), pcmcia(5), ifport(8). pcmcia-cs 2000/06/12 21:24:48 SMC91C92_CS(4)
All times are GMT -4. The time now is 04:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy