Mike Posted March 21, 2004 Share Posted March 21, 2004 ok this is my current setup... this pc (windows - 192.168.0.10) connected to my linux box (192.168.0.1) and then the linux box (192.168.1.10) connect to linksys router (192.168.1.1) i current have a few ports forwarded in the router to the linux box and then onto this pc working fine. however, the logging feature on my router doesnt get forwarded (uses snmp). whatever iptables config i try i cant seem to get it to work :( using the log feature in iptables i think the snmp packets from the router are only noticed on the INPUT chain and my other port forwards are on the PREROUTING chain. is there a way to forward the snmp packets to this pc? (sorry if its a bit confusing :)) Link to comment Share on other sites More sharing options...
markwolfe Veteran Posted March 21, 2004 Veteran Share Posted March 21, 2004 Question: Is there a reason you don't just connect both PCs directly to the router? Or are you doing something specific in the Linux box (like filtering or something) that you wanted to be done before traffic gets to your Windows PC? Link to comment Share on other sites More sharing options...
SintaX Posted March 21, 2004 Share Posted March 21, 2004 actually what is the purpose of the linksys router ? i use my linux box as a router =] Link to comment Share on other sites More sharing options...
Mike Posted March 21, 2004 Author Share Posted March 21, 2004 2 reasons, one being i dont have a cable long enough to reach the router and if i did i would have to put the cable around the room and cover it up which i can't be bothered doing. secondly, i want to learn about networking in linux the purpose of the linksys router is for my dad's and sister's comps and for security as i dont know enough about linux & networking yet :) Link to comment Share on other sites More sharing options...
kyro Posted March 21, 2004 Share Posted March 21, 2004 simple solution ... does turning off iptables forwards the packet ?. if yes .. now u know what to work on. Link to comment Share on other sites More sharing options...
Mike Posted March 21, 2004 Author Share Posted March 21, 2004 if i turned iptables off, how would it forward the packet if it wasnt running? also, other ports i've set are being forwarded fine Link to comment Share on other sites More sharing options...
kyro Posted March 21, 2004 Share Posted March 21, 2004 :blush: humm will read the post later Link to comment Share on other sites More sharing options...
Mike Posted March 23, 2004 Author Share Posted March 23, 2004 using iptables -t nat -A PREROUTING -i eth0 -p udp --dport 162 -j LOG --log-level 0 i can get it to log the snmp packets but using: iptables -t nat -A PREROUTING -i eth0 -p udp --dport 162 -j DNAT --to 192.168.0.10 it doesn't get forwarded :( is there something missing/wrong? Link to comment Share on other sites More sharing options...
SintaX Posted March 31, 2004 Share Posted March 31, 2004 I have a hard time memorizing alot of those commands, I made a text file with the ones i use alot and for reference, i will paste them once i get back to my house. Link to comment Share on other sites More sharing options...
Mike Posted March 31, 2004 Author Share Posted March 31, 2004 thnx but i fixed my problem now, if anyone elses wants to know its because the snmp data was broadcast data which iptables wont forward and so i set my router to log to a specific ip and it all works fine now :) Link to comment Share on other sites More sharing options...
Recommended Posts