What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Edit IPTABLES to redirect to a different IP

Tim J

New Around Here
I have come across an issue where I have a slave employee time clock that is coded with an IP address to communicate with master time clock at a different location. The IP address for where the master clock is does not have a static IP address. I have no way of changing the IP on the slave clock without deleting all the data on it that I need.

I think I can change the iptables in my Asus router by going in and executing the below command but nothing happening and when I look at the logs it is still trying to communicate to the old IP and not the one I want it to.

iptables -t nat -A OUTPUT -p tcp -d (IP Clock wants to communicate with) --dport 10923 -j DNAT --to-destination (NEWIP):10923

Any thoughts?

Thanks Tim
 
Try using the PREROUTING chain.
Code:
iptables -t nat -A PREROUTING -p tcp -d (IP Clock wants to communicate with) --dport 10923 -j DNAT --to-destination (NEWIP):10923
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top