Hi there, I have a script which loops through the physical interfaces of a box and populates a variable called $NIC with the interface name
so if for example $NIC is equal to "e1000g0", I am trying to figure out some awk that will get the IP for that interface from ifconfig output
Code:
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
inet 10.1.1.1 netmask ffff0000 broadcast 10.1.255.255
ether 0:14:4f:xx.xx.xa
e1000g1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
inet 10.1.1.2 netmask ffff0000 broadcast 10.1.255.255
ether 0:14:4f:xx.xx.xb
Ive been trying to set up an awk statement that sets a variable called X to "1" when it find the interface in question (in this case e1000g0) and then start searching for the line containing the string "inet", then print £2 and set X=0 again so that it wont print any more
Apologies for my inexperience with awk, but does am i close with the following syntax ? please feel free to shoot me down :-) ive been trying all sorts of variatiosn but i cant get it to work
I asked a similar question earlier and got a very good answer but a new doubt came up. This is a few lines of a '/sbin/ifconfig' command on my PC:
RX packets:3781025 errors:0 dropped:0 overruns:0 frame:0
TX packets:1941909 errors:0 dropped:0 overruns:0 carrier:0
Does the RX and TX packets... (1 Reply)
SunOS Release 5.7.
Original ifconfig -a output:
pnt0: flags=863<UP, BROADCAST,NOTRAILERS........
inet 10.2.34.49 netmask fffffe00 broadcast 10.2.34.255 ...
Attempted to change ip address for pnt0. Typed the following command and forgot the "netmask"
"ifconfig pnt0 10.2.35.49... (1 Reply)
This will most likely be a real dumb question for a HP-UX admin, but here it goes anyhow.
lan0 - is up and configured
lan1 - is down, I want to bring it up.
lanconfig....ifconfig is there a difference?
My real question is, in solaris there is an /etc/hostname."?" file, is there a... (4 Replies)
I am trying to change an IP address on a machine running HPUX10
After I change it I can ping it from the outside but it completely locks the console. After a reboot it returns back to its previous IP. Any ideas??
Thanks
Brian (7 Replies)
if i have the command ifconfig eth0, what will the output be and how can i use either awk or grep to isolate and display the IP address, subnet mask and physical address of my host (1 Reply)
On prior versions to solaris 10 when I want to add/change the IP address of an interface I will use this command.
ifconfig eri0 down
ifconfig eri0 192.xxx.xxx.xxx netmask 255.xxx.xxx.xxx up
then change /etc/hosts so that /etc/hostname.eri0 picks up on the correct IP.
I strange thing... (2 Replies)
why the ifconfig command is not working in my machine?
it says "-bash: ifconfig: command not found"
why its says that?
actually i m looking for "how can I know the Network Interface Card physical address?"
Requesting u all for help.
thanks (3 Replies)
I have a script problem that I am not able to solve due my very limited understanding of unix/awk.
This is the contents of test.sh
awk '{print $1}'
From the prompt if I enter:
./test.sh Hello World
I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
Hi Experts,
I am trying to get system output to capture inside awk , but not working:
Please advise if this is possible :
I am trying something like this but not working, the output is coming wrong:
echo "" | awk '{d=system ("date") ; print "Current date is:" , d }'
Thanks, (5 Replies)
Discussion started by: rveri
5 Replies
LEARN ABOUT NETBSD
eshconfig
ESHCONFIG(8) BSD System Manager's Manual ESHCONFIG(8)NAME
eshconfig -- configure Essential Communications' HIPPI network interface
SYNOPSIS
eshconfig [-estx] [-b bytes] [-c bytes] [-d filename] [-i usecs] [-m bytes] [-r bytes] [-u filename] [-w bytes] [interface]
DESCRIPTION
eshconfig is used to configure device-specific parameters and download new firmware to the Essential Communications RoadRunner-based HIPPI
network interface. The interface is very sensitive to the DMA performance characteristics of the host, and so requires careful tuning to
achieve reasonable performance. In addition, firmware is likely to change frequently, which necessitates a reasonably easy way to update
that firmware.
Available operands for eshconfig:
-b bytes
Adjust the burst size for read (by NIC of host memory) DMA.
-c bytes
Adjust the burst size for write (by NIC of host memory) DMA.
-d filename
Filename for file to download into NIC firmware. This must be a file in the standard Essential format, with :04 preceding every
line, and a tag line at the end indicating the characteristics of the firmware file.
-e Write data to EEPROM. Normally, setting tuning parameters will only persist until the system is rebooted. Setting this parameter
ensures that the changes will be written to EEPROM.
-i usecs
Interrupt delay in microseconds.
-m bytes
Minimum number of bytes to DMA in one direction (read or write) before allowing a DMA in the other direction. Tuning this prevents
one direction from dominating the flow of bytes, and artificially throttling the NIC.
-r bytes
Bytes before DMA starts for read (from host to NIC). This controls how soon the DMA is triggered; until this many bytes are
requested, the DMA will not begin.
-s Show statistics for the HIPPI NIC. Repeat the option to suppress non-zero statistics.
-t Show current tuning parameters on the host.
-u filename
Name of file to which the NIC firmware should be uploaded. Not currently supported.
-w bytes
Number of bytes required before write (from NIC to host) DMA is started. Until this many bytes are ready to be written, the DMA will
not start.
-x Reset the NIC. This is necessary for the HIPPI-FP support, as ifconfig(8) will no longer physically reset the NIC when the inter-
faces goes up and down.
Only the super-user may modify the configuration of a network interface.
DIAGNOSTICS
Messages indicating the specified interface does not exist or the user is not privileged and tried to alter an interface's configuration.
SEE ALSO esh(4), ifconfig(8)HISTORY
The eshconfig command first appeared in NetBSD 1.4.
BSD June 17, 2005 BSD