Sponsored Content
Top Forums Shell Programming and Scripting how grep the inet address for in ifconfig command Post 302245177 by Franklin52 on Thursday 9th of October 2008 02:16:16 PM
Old 10-09-2008
Should be something like:

Code:
ifconfig | awk '/^eth/{s=$1;getline;print s,$1,$2}'

Regards
 

10 More Discussions You Might Find Interesting

1. Solaris

ifconfig bad address

hi all iam trying to set my eri0 interface but with little luck . when i set the ip using ipconfig i always get "bad adress".. moreover when i use ifconfig eri0 i can notice that the inet is 0.0.0.0 and the netmask 0 i am runnig solaris 9 on sparc . any helpis highly appreciated ... ... (2 Replies)
Discussion started by: ppass
2 Replies

2. UNIX for Dummies Questions & Answers

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 (1 Reply)
Discussion started by: carlvernon
1 Replies

3. IP Networking

Setting primary ip address with ifconfig

Hello, I have a server with two ip addresses. I need to make the ip address that's currently the secondary the primary. How do I use the ifconfig command and primary option? Thanks. (5 Replies)
Discussion started by: pmichner
5 Replies

4. IP Networking

ifconfig: ce401001: bad address

HI All, My interface card has failed.If i am giving the command to uplumb it i am getting an error. ce401001: flags=219040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,FAILED,CoS> mtu 1500 index 3 inet 10.188.24.18 netmask ffffffc0 broadcast 10.188.24.63 # ifconfig... (2 Replies)
Discussion started by: sag71155
2 Replies

5. 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

6. Shell Programming and Scripting

script to get IP address from ifconfig

I'm a newbie to linux, so pleases forgive me! I would like to find a script that I could use to extract a dynamic ip from the ppp0 and set it as a variable to be used in IPTables basically, if ppp0 ip address is 10.10.10.20, I would like a script that would set a var to 10.10.10.0. of... (9 Replies)
Discussion started by: speedy3k
9 Replies

7. IP Networking

IP Address not found in ifconfig/netstat

I'm working on an AIX Unix LPAR (AIX 3.5 00C3C9904C00 as returned by uname -a) I can access this box using telnet, port 22 using adress IP A and B A=AA.AA.XX.XX and B=AA.AA.YYY.YYY I can confirm these 2 are the same space, I can see I can't find address B listed anywhere... so I wonder what... (1 Reply)
Discussion started by: Isax50
1 Replies

8. Solaris

ifconfig - making netmask & broadcast address permanent?

hi, I am trying to configure one of my interfaces, but after reboot - i lose the changes to the netmask & broadcast address. I have added an entry in /etc/netmasks, but it doesnt pick up the new settings. any ideas - much appreciated. before reboot: eri0:... (3 Replies)
Discussion started by: badoshi
3 Replies

9. Shell Programming and Scripting

extracting the ip address from ifconfig

Hi I am trying to create a script extracting the IP provided by ifconfig. I tried with grep + awk but I am returned more than I need. /sbin/ifconfig eth0 | grep "inet addr:" | awk '/inet addr:/ { print $2 }' and returns addr:10.15.1.64 How can I remove "addr:" string?... (9 Replies)
Discussion started by: manustone
9 Replies

10. Solaris

Ifconfig command ?

What would be the command to remove the IP address from an interface? I want to remove the ip from this interface: ce3: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index 5 inet 155.216.13.74 netmask fffffff0 broadcast 155.216.13.79 ether 0:3:ba:da:a6:96 (3 Replies)
Discussion started by: Kjons76
3 Replies
IWI(4)							   BSD Kernel Interfaces Manual 						    IWI(4)

NAME
iwi -- Intel PRO/Wireless 2200BG/2915ABG IEEE 802.11 driver SYNOPSIS
iwi* at pci? dev ? function ? DESCRIPTION
The iwi driver provides support for Intel(R) PRO/Wireless 2200BG and 2915ABG MiniPCI network adapters. By default, the iwi driver configures the adapter for BSS operation (aka infrastructure mode). This mode requires the use of an access point. For more information on configuring this device, see ifconfig(8). The Intel firmware requires acceptance of the End User License Agreement. The full license text can be found in /libdata/firmware/if_iwi/LICENSE.ipw2200-fw. The license is agreed to by setting the sysctl variable hw.iwi.accept_eula to 1. EXAMPLES
Join an existing BSS network (i.e.: connect to an access point): ifconfig iwi0 inet 192.168.0.20 netmask 0xffffff00 Join a specific BSS network with network name ``my_net'': ifconfig iwi0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net Join a specific BSS network with 64 bits WEP encryption: ifconfig iwi0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net nwkey 0x1234567890 Join a specific BSS network with 128bits WEP encryption: ifconfig iwi0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net nwkey 0x01020304050607080910111213 DIAGNOSTICS
iwi%d: device timeout The driver will reset the hardware. This should not happen. SEE ALSO
an(4), awi(4), ipw(4), pci(4), wi(4), ifconfig(8), iwictl(8), firmload(9) The IWI Web Page, http://damien.bergamini.free.fr/ipw/. AUTHORS
The iwi driver and this man page were written by Damien Bergamini <damien.bergamini@free.fr>. BSD
February 5, 2009 BSD
All times are GMT -4. The time now is 06:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy