On Friday 26 October 2007 22:13, lists user wrote: > Hello, Hello,
> I want to do the things below: > > a) get all binded IPs on a redhat linux os.there are maybe more than > one IP,like eth0,eth1,eth0:1 etc. Just Ethernet NICs? What about Token Ring? DECNet? Wifi? IP6 tunneled through IP4? > b) for each IP,I need to know if it's a private network address (like > 192.168.0.1) or a public network address. No problem, just grap a copy of RFC1918. > for the first problem I can read something from > /etc/sysconfig/network-script/ifcfg-eth*, or code with @ips = > `/sbin/ifconfig` and use regex to capture the IPs.But I don't think > these are the best ways. > > I don't like to use any CPAN module,b/c I'm not admin user,don't have > privileges to install those modules. > > Can you show me a good way? Thanks! Either use `/sbin/ifconfig` or the file /proc/net/arp (or write your own program to do what ifconfig does.) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/