[Freeswitch-users] Auto-detecting Local IP when no gateway set
EL
fs.user at fordior.net
Mon Aug 19 18:23:37 MSD 2013
> /sbin/ifconfig $1 | grep "inet addr" | awk -F: '{print $2}' | awk '{print
> $1}'
To make it a bit less ancient:
========
/bin/ip -o addr show | grep inet | awk '{print $4}' | awk -F/ '{print $1}'
or just for eth0:
/bin/ip -o addr show eth0 | grep inet | awk '{print $4}' | awk -F/ '{print $1}'
========
This might be an interesting article to read, regarding ifconfig:
http://inai.de/2008/02/19
Further interesting peace of information regarding linux/iptables
(section 'Mythbusting time') see: http://inai.de/links/iptables/
I hope this information may be usefull to you.
--
EL
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list