04-30-2006
Hello,
For Linux boxes I use this one-liner:
Quote:
$ IP=`/sbin/ifconfig eth1 | grep "inet addr" | cut -d ":" -f 2 | cut -d " " -f 1`
$ echo $IP
192.168.0.210
You can try also parsing the output of the command "ip a l", perhaps it's more efficient...
Quote:
$ ip a l eth1
6: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:05:1c:03:26:36 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.210/24 brd 192.168.0.255 scope global eth1
Regards,
--
Santi Saez
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
say I have a IP address which is 10.0.0.12, and subnet mask is 255.255.255.240, what is the network address and what is the broadcast address which host lives on?
And could you explain how to get the answer?
thanx in advance! (7 Replies)
Discussion started by: pnxi
7 Replies
2. IP Networking
Hi sir,
i want to make such programe which takes MAC(Ethernet) address of any host & give me its IP address.......
but i'm nt getting that how i can pass the MAC address to Frame........
Please give me an idea for making such program...
Thanks & regards
Krishna (3 Replies)
Discussion started by: krishnacins
3 Replies
3. UNIX for Advanced & Expert Users
We are using software (Pegasys) which runs on SunOS 5.8 and reads images from a Philips nuclear camera. The software is designed to run from the console. I need to be able to capture the images it produces on the display. The caveat is that I cannot use the X Windows display because the X Server... (3 Replies)
Discussion started by: sreyes27
3 Replies
4. Shell Programming and Scripting
Trying to do a ksh script that needs to list all ip address between ip address a and b ..
ie.
Ip address A=192.168.1.200
Ip address B=192.168.2.15
So the subnet changes from 1 to 2 but I want to list all possible ip addresses between the 2..
Which would be:
192.168.1.200... (4 Replies)
Discussion started by: frustrated1
4 Replies
5. UNIX for Dummies Questions & Answers
:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message:
PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14
KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD)
EAX=EF822000... (10 Replies)
Discussion started by: Twix
10 Replies
6. UNIX for Dummies Questions & Answers
:confused:Hi
This was installed on the Linux box a few weeks back by a guy that no longer works for us. All worked fine until last week. Now when we connect its just a blank screen with no icons.
I get a whole bunch of errors when starting the service too:
Tue Feb 23 14:29:45 2010
... (1 Reply)
Discussion started by: wbdevilliers
1 Replies
7. UNIX for Dummies Questions & Answers
Hi guys,
I got one problem which I definetily no idea.
What would the physical address be for virtual address?
1) 2ABC
2) 3F4B
Here is the page table:see attached
Thank you sos sososososso much!! (0 Replies)
Discussion started by: lemon_06
0 Replies
8. IP Networking
Hi there
I lost connectivity to one of our remote systems and when I checked the messages log I found the following:
Aug 10 23:42:34 host xntpd: time reset (step) 1.681729 s
Aug 16 13:20:51 host ip: WARNING: node "mac address" is using our IP address x.x.x.x on aggr1
Aug 16 13:20:51 host... (9 Replies)
Discussion started by: notreallyhere
9 Replies
9. UNIX for Dummies Questions & Answers
Hi Gurus,
Can some one explain me the difference between a IP console and a serial console. (1 Reply)
Discussion started by: rama krishna
1 Replies
10. UNIX for Advanced & Expert Users
Hi ,
Could someone let me know how to detect duplicate ip address after assigning ip address to ethernet interface using c program (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies
LEARN ABOUT PLAN9
tc-matchall
Match-all classifier in tc(8) Linux Match-all classifier in tc(8)
NAME
matchall - traffic control filter that matches every packet
SYNOPSIS
tc filter ... matchall [ skip_sw | skip_hw ] [ action ACTION_SPEC ] [ classid CLASSID ]
DESCRIPTION
The matchall filter allows to classify every packet that flows on the port and run a action on it.
OPTIONS
action ACTION_SPEC
Apply an action from the generic actions framework on matching packets.
classid CLASSID
Push matching packets into the class identified by CLASSID.
skip_sw
Do not process filter by software. If hardware has no offload support for this filter, or TC offload is not enabled for the inter-
face, operation will fail.
skip_hw
Do not process filter by hardware.
EXAMPLES
To create ingress mirroring from port eth1 to port eth2:
tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff:
matchall skip_sw
action mirred egress mirror
dev eth2
The first command creats an ingress qdisc with handle ffff: on device eth1 where the second command attaches a matchall filters on it that
mirrors the packets to device eth2.
To create egress mirroring from port eth1 to port eth2:
tc qdisc add dev eth1 handle 1: root prio
tc filter add dev eth1 parent 1:
matchall skip_sw
action mirred egress mirror
dev eth2
The first command creats an egress qdisc with handle 1: that replaces the root qdisc on device eth1 where the second command attaches a
matchall filters on it that mirrors the packets to device eth2.
To sample one of every 100 packets flowing into interface eth0 to psample group 12:
tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: matchall
action sample rate 100 group 12
SEE ALSO
tc(8),
iproute2 21 Oct 2015 Match-all classifier in tc(8)