IP Tables Saga...:(

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
arnab.roy
Posts: 354
Joined: Sat Apr 30, 2011 10:24 am

IP Tables Saga...:(

Post by arnab.roy »

Hi Guys,

I have a bizarre one here, setting up an XI server at a customer site for monitoring their stuff, I was happily all the network switches until we needed to cross subnet boundaries and add switches from a different subnet , it looks like iptables is somehow managing to block snmp queries from other subnets, just confirm I can ssh and ping to the remote hosts only SNNP problems...

here is my rule chain output

Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT udp -- anywhere anywhere state NEW udp dpt:snmp
ACCEPT udp -- anywhere anywhere state NEW udp dpt:snmptrap
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Any suggestions how I can fix this without permanently shutting down iptables ...

Many Thanks
Arnab
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: IP Tables Saga...:(

Post by lmiltchev »

Have you confirmed that it's working when iptables is stopped?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
arnab.roy
Posts: 354
Joined: Sat Apr 30, 2011 10:24 am

Re: IP Tables Saga...:(

Post by arnab.roy »

Yes snmpwalk works a treat as soon as I hit service iptables stop !!!
User avatar
arnab.roy
Posts: 354
Joined: Sat Apr 30, 2011 10:24 am

Re: IP Tables Saga...:(

Post by arnab.roy »

This is not resolved by the way dont know why the tick was put next to the post...:p
XenoPhage
Posts: 56
Joined: Sun Jun 03, 2012 11:37 am

Re: IP Tables Saga...:(

Post by XenoPhage »

Add a log line before the reject in your input chain. That should provide you some logging to identify what, exactly, is being blocked.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: IP Tables Saga...:(

Post by scottwilkerson »

I don't have these 2 lines in my iptables and can make the requests just fine

Code: Select all

ACCEPT udp -- anywhere anywhere state NEW udp dpt:snmp
ACCEPT udp -- anywhere anywhere state NEW udp dpt:snmptrap
this should fall under

Code: Select all

ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
As the Nagios server is initiating the connection, and the connection isn't going into the XI server on the snmp port, it is connecting to the external server on that port..
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
arnab.roy
Posts: 354
Joined: Sat Apr 30, 2011 10:24 am

Re: IP Tables Saga...:(

Post by arnab.roy »

this is only happenning if the remote host is on another l3 subnet devices on the same subnet works just fine....
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: IP Tables Saga...:(

Post by scottwilkerson »

I would think this was related to an external router blocking the UDP traffic if you hadn't said it works fine with IP tables turned off...

Are you running the same test with iptables on and off?

Also, I'm going to ask a question that may be totally unrelated, but is selinux enabled on the system?

I only ask because it seems to creep in and break things all the time...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
arnab.roy
Posts: 354
Joined: Sat Apr 30, 2011 10:24 am

Re: IP Tables Saga...:(

Post by arnab.roy »

hi scott,

yes i also thought this was related to an external router etc ..however after troubleshooting the whole network across 10ss of routers ..it turned out to be iptables...selinux as far as i know should be off doesnt the xi install script get rid of it i will double check, can you tell me how i can see what packets are being dropped by iptables ?

cheers

arnab
XenoPhage
Posts: 56
Joined: Sun Jun 03, 2012 11:37 am

Re: IP Tables Saga...:(

Post by XenoPhage »

arnab.roy wrote:hi scott,

yes i also thought this was related to an external router etc ..however after troubleshooting the whole network across 10ss of routers ..it turned out to be iptables...selinux as far as i know should be off doesnt the xi install script get rid of it i will double check, can you tell me how i can see what packets are being dropped by iptables ?

cheers

arnab
Before the DROP rule, add a rule to log :

-A INPUT -j LOG --log-prefix 'Firewall: '

Then all dropped packets will appear in /var/log/messages
Locked