Q1. Why netflow traffic accounting information is not available for FastEthernet
subinterfaces ?
A1. Some IOS versions not support SNMP numbers assign for subinterfaces. You can check
does your IOS support subinterfaces netflow traffic accounting. Run the following command:
snmpwalk router community interfaces.ifTable.ifEntry.ifDescr
if you see something like:
...
interfaces.ifTable.ifEntry.ifDescr.2 = FastEthernet0/0
...
interfaces.ifTable.ifEntry.ifDescr.18 = FastEthernet0/0.1
interfaces.ifTable.ifEntry.ifDescr.19 = FastEthernet0/0.2
interfaces.ifTable.ifEntry.ifDescr.20 = FastEthernet0/0.3
interfaces.ifTable.ifEntry.ifDescr.23 = FastEthernet0/0.6
...
than your IOS supports this feature. Otherwise if you see only:
interfaces.ifTable.ifEntry.ifDescr.2 = FastEthernet0/0
you have to change IOS version.
Q3. How can I translate IP address to readable format and vice versa, when binary
address storage is used?
A3. New MySQL versions have function for IP address manipulation INET_ATON()
and INET_NTOA():
mysql> select INET_ATON('193.125.78.1');
+---------------------------+
| INET_ATON('193.125.78.1') |
+---------------------------+
| 3246214657 |
+---------------------------+
1 row in set (0.00 sec)
mysql> select INET_NTOA(3246214657);
+-----------------------+
| INET_NTOA(3246214657) |
+-----------------------+
| 193.125.78.1 |
+-----------------------+
1 row in set (0.00 sec)
mysql>
also, you can do the same using external program:
#!/usr/bin/perl -w
#
# inet_aton.pl
#
($a[0], $a[1], $a[2], $a[3]) = split (/\./,$ARGV[0]);
$aaa = pack ("C4", $a[0], $a[1], $a[2], $a[3]);
$bin_addr = unpack ("N*", $aaa);
print $bin_addr,"\n";
#!/usr/bin/perl -w
#
# inet_ntoa.pl
#
$xxx = pack ("N", $ARGV[0]);
@aaa = unpack ("C4", $xxx);
print $aaa[0],".",$aaa[1],".",$aaa[2],".",$aaa[3],"\n";