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
PBFIFO(8)                                                              Linux                                                             PBFIFO(8)

NAME
pfifo - Packet limited First In, First Out queue bfifo - Byte limited First In, First Out queue SYNOPSIS
tc qdisc ... add pfifo [ limit packets ] tc qdisc ... add bfifo [ limit bytes ] DESCRIPTION
The pfifo and bfifo qdiscs are unadorned First In, First Out queues. They are the simplest queues possible and therefore have no overhead. pfifo constrains the queue size as measured in packets. bfifo does so as measured in bytes. Like all non-default qdiscs, they maintain statistics. This might be a reason to prefer pfifo or bfifo over the default. ALGORITHM
A list of packets is maintained, when a packet is enqueued it gets inserted at the tail of a list. When a packet needs to be sent out to the network, it is taken from the head of the list. If the list is too long, no further packets are allowed on. This is called 'tail drop'. PARAMETERS
limit Maximum queue size. Specified in bytes for bfifo, in packets for pfifo. For pfifo, defaults to the interface txqueuelen, as speci- fied with ifconfig(8) or ip(8). The range for this parameter is [0, UINT32_MAX]. For bfifo, it defaults to the txqueuelen multiplied by the interface MTU. The range for this parameter is [0, UINT32_MAX] bytes. Note: The link layer header was considered when counting packets length. OUTPUT
The output of tc -s qdisc ls contains the limit, either in packets or in bytes, and the number of bytes and packets actually sent. An unsent and dropped packet only appears between braces and is not counted as 'Sent'. In this example, the queue length is 100 packets, 45894 bytes were sent over 681 packets. No packets were dropped, and as the pfifo queue does not slow down packets, there were also no overlimits: # tc -s qdisc ls dev eth0 qdisc pfifo 8001: dev eth0 limit 100p Sent 45894 bytes 681 pkts (dropped 0, overlimits 0) If a backlog occurs, this is displayed as well. SEE ALSO
tc(8) AUTHORS
Alexey N. Kuznetsov, <kuznet@ms2.inr.ac.ru> This manpage maintained by bert hubert <ahu@ds9a.nl> iproute2 10 January 2002 PBFIFO(8)
All times are GMT -4. The time now is 09:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy