You can only do one -if-filter , but it can be as complex as you like. Things to note -
1) ALWAYS surround it in single quotes under UNIX so as to prevent accidental variable expansion by the shell. 2) The filter evaluates to TRUE if the interface is kept. 3) $default is TRUE if the interface would normally have been kept 4) The filter is in fact a snippet of Perl code, so you can put anything you like in there. So... --if-filter='($default and $if_type!=1 and $if_type!=101 and $if_type!=102 and $if_type!=103)' Or, if you prefer, this is slightly more efficient: --if-filter='($default and $if_type!=1 and ($if_type<101 or $if_type>103))' This should do what you're asking for. Note that you can use '&&' or 'and', the former does a bitwise AND and the latter does a logical one (0 is false, anything else is true). Since the flags are set to 1 it shouldn't make any difference which you use but I feel 'and' is safer) Steve ________________________________ From: Mersberger, Robert [mailto:[email protected]] Sent: Wednesday, 2 September 2009 7:54 a.m. To: Steve Shipway; [email protected] Subject: RE: How can I eliminate interfaces from CFG files ? after reading the manual I am somewhat confused. I tried with the following filter and it seemed to work in that it commented out all type 1 interface but it also commented out type 103 interface. This was close to what I want to do so I tried it on another router (same series router) and get different results. This is the filter I used for both. --if-filter="$default && $if_type !=1" What I am looking to accomplish is to omit all if_type 1, 101, 102, 103 These were or are all associated with the phone interfaces How would you suggest I do this? can I do Multiple --if-filters and can I specify a range? I have included the latest and really only attempt that seem to almost work. Hope you can help me understand.
_______________________________________________ mrtg mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
