Sponsored Content
Top Forums UNIX for Dummies Questions & Answers ifconfig eth0 and awk and grep Post 302075278 by carlvernon on Thursday 1st of June 2006 08:18:50 AM
Old 06-01-2006
Lightbulb ifconfig eth0 and awk and grep

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
 

10 More Discussions You Might Find Interesting

1. IP Networking

Adding an IP to eth0

Hi there guys! I have a small task that I have to accomplish, but I don't seem to be able to do that. I have a server that I don't have physical access to, and I mostly control it with webmin. The server is running 2 websites. Both of these websites have their own domains that are linked to... (1 Reply)
Discussion started by: D-Lexy
1 Replies

2. Shell Programming and Scripting

MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else

Hi Guys, I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys. MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' ` Harby. (4 Replies)
Discussion started by: hariza
4 Replies

3. Shell Programming and Scripting

how grep the inet address for in ifconfig command

hi, i want to know how to grep inet address for below below is the output of ifconfig command /home/JA> ifconfig eth0 Link encap:Ethernet HWaddr 00:11:0A:5B:2E:E9 inet addr:161.239.203.18 Bcast:161.239.203.127 Mask:255.255.255.128 UP BROADCAST RUNNING... (3 Replies)
Discussion started by: mail2sant
3 Replies

4. Shell Programming and Scripting

how to grep only IP address of e1000g0 using ifconfig -a

Hello All, Can someone show me how to cat "only the IP address of e1000g0" using ifconfig -a. i am trying to grep only the ip address (xx.xx.xx.xx) from the bunch of all other things like, broadcast address, IPV4, UP........and so on. thanks (1 Reply)
Discussion started by: solaix14
1 Replies

5. UNIX for Dummies Questions & Answers

how can I find which one is eth0?

Hi, Just installed Centos 5.1 on HP DL360, on this system I have to close to ten nic's. How can I find which one is eth0? When I do " ifconfig -a" I see all of them, but I can't tell which is eth0? Please advice. (2 Replies)
Discussion started by: samnyc
2 Replies

6. Shell Programming and Scripting

awk question - getting ip from ifconfig

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 lo0:... (9 Replies)
Discussion started by: rethink
9 Replies

7. Shell Programming and Scripting

AWK/GREP: grep only lines starting with integer

I have an input file 12.4 1.72849432773174e+01 -7.74784188610632e+01 12.5 9.59432114416327e-01 -7.87018212757537e+01 15.6 5.20139995965960e-01 -5.61612429666624e+01 29.3 3.76696387248366e+00 -7.42896194101892e+01 32.1 1.86899877018077e+01 -7.56508762501408e+01 35 6.98857157014640e+00... (2 Replies)
Discussion started by: chrisjorg
2 Replies

8. Red Hat

Eth0 Limitations

Hi, I have noticed some performance issues on my RHEL5 server but the memory and CPU utilization on the box is fine. I have a 1G full duplexed eth0 card and I am suspicious that this may be causing the problem. My eth0 settings are as follows: Settings for eth0: Supported ports: ... (12 Replies)
Discussion started by: Duffs22
12 Replies

9. Red Hat

ifconfig eth0 unplumb equivalent

ifconfig eth0 unplumb will perfectly work on solaris , but linux dont support unplumb option ..what is the correct way to remove the interface , forgive me if this topic is already discussed .. i tried this rename /etc/sysconfig/network-scripts/ifcfg-eth0 & restart the network service ..... (4 Replies)
Discussion started by: skamal4u
4 Replies

10. UNIX for Dummies Questions & Answers

Piping grep into awk, read the next line using grep

Hi, I have a number of files containing the information below. """"" Fundallinfo 6.3950 14.9715 14.0482 """"" I would like to grep for Fundallinfo and use it to read the next line? I ideally would like to read the three numbers that follow in the next line and... (2 Replies)
Discussion started by: Paul Moghadam
2 Replies
IPSEC_INITSUBNET(3)					     Library Functions Manual					       IPSEC_INITSUBNET(3)

NAME
ipsec_initsubnet, ipsec_addrtosubnet, ipsec_subnettypeof, ipsec_masktocount, ipsec_networkof, ipsec_maskof - initialize an ip_subnet, ini- tialize a singleton ip_subnet, get address type of an ip_subnet, convert subnet mask to bit count, get base address of an ip_subnet, get subnet mask of an ip_subnet SYNOPSIS
#include <freeswan.h> const char *initsubnet(const ip_address *addr, int maskbits, int clash, ip_subnet *dst); const char *addrtosubnet(const ip_address *addr, ip_subnet *dst); int subnettypeof(const ip_subnet *src); int masktocount(const ip_address *src); void networkof(const ip_subnet *src, ip_address *dst); void maskof(const ip_subnet *src, ip_address *dst); DESCRIPTION
The <freeswan.h> library uses an internal type ip_subnet to contain a description of an IP subnet (base address plus mask). These func- tions provide basic tools for creating and examining this type. Initsubnet initializes a variable *dst of type ip_subnet from a base address and a count of mask bits. The clash parameter specifies what to do if the base address includes 1 bits outside the prefix specified by the mask (that is, in the ``host number'' part of the address): '0' zero out host-number bits 'x' non-zero host-number bits are an error Initsubnet returns NULL for success and a pointer to a string-literal error message for failure; see DIAGNOSTICS. Addrtosubnet initializes an ip_subnet variable *dst to a ``singleton subnet'' containing the single address *addr. It returns NULL for success and a pointer to a string-literal error message for failure. Subnettypeof returns the address type of a subnet, normally AF_INET or AF_INET6. (The <freeswan.h> header file arranges to include the necessary headers for these names to be known.) Masktocount converts a subnet mask, expressed as an address, to a bit count suitable for use with initsubnet. It returns -1 for error; see DIAGNOSTICS. Networkof fills in *dst with the base address of subnet src. Maskof fills in *dst with the subnet mask of subnet src, expressed as an address. SEE ALSO
inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3) DIAGNOSTICS
Fatal errors in initsubnet are: unknown address family; unknown clash value; impossible mask bit count; non-zero host-number bits and clash is 'x'. Fatal errors in addrtosubnet are: unknown address family. Fatal errors in masktocount are: unknown address family; mask bits not contiguous. HISTORY
Written for the FreeS/WAN project by Henry Spencer. 12 March 2002 IPSEC_INITSUBNET(3)
All times are GMT -4. The time now is 12:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy