Ashley M. Kirchner wrote:

I have an RH9 server on a cable modem and I'm trying to figure out how to auto-update /etc/sysconfig/iptables whenever my IP changes. Right now, I have to manually edit that file to put the new IP in it. Right now I'm looking at 4 separate lines, across different sections of the file. Is there some way to automatically do that? Is there some way to avoid having the IP hardcoded in the first place?

Yes, there is. I have a dial-up which changes it's IP address. I think you need to NOT refer to the DHCP IP ADDRESS but the INTERFACE itself.


My memory is bad, and I can't look at the moment, but I seem to remember echoing a 1 to a dyn_addr /proc file somewhere too.

Under *nat
-A POSTROUTING -o eth0 -j SNAT --to-source <DHCP IP ADDRESS>

Under *filter:
-A INPUT -s <DHCP IP ADDRESS> -i lo -j ACCEPT
-A INPUT -d <DHCP IP ADDRESS> -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -s <DHCP IP ADDRESS> -j ACCEPT



Regards, Ed.



--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to