Welcome to WebmasterWorld Guest from 54.211.17.91

Forum Moderators: bakedjake

Message Too Old, No Replies

Iptables

Iptables

   
4:35 am on Feb 21, 2012 (gmt 0)



Hello,


I have a server behind a proxy. I need to whitelist the proxy ip. I'm new at this.


I have tried the code below

/sbin/iptables -I INPUT -i eth0 -s 111.11.11.11 -j ACCEPT

The Ip isn't real just example.

I think it worked i'm not sure if thats permanent solution.
If I restart the server will it stay whitelisted?


Thank you
4:44 am on Feb 21, 2012 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Normally rules which you add by hand will only stay active until the next reboot. To be sure that the rule is permanent, you have to add it to the list of iptables rules which is read on startup. On RedHat/Centos/Fedora family of distributions, the startup configuration is stored in the file /etc/sysconfig/iptables

You can add the new rule there by hand (not recommended) or store your current iptables configuration in the file with the following command:

/sbin/iptables-save > /etc/sysconfig/iptables
5:03 am on Feb 21, 2012 (gmt 0)



I forgot to mention the OS it's ubuntu 11.10 sorry
5:05 am on Feb 21, 2012 (gmt 0)



What would be the command once I put in

/sbin/iptables -I INPUT -i eth0 -s 111.11.11.11 -j ACCEPT

Then to save it for ubuntu 11.10


Thank you for your help!
5:35 am on Feb 21, 2012 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I have no recent Ubuntu installation to test, but I remember that Ubuntu saves the iptables configuration in /etc/iptables.rules You may want to check if that file exists on your server.
5:38 am on Feb 21, 2012 (gmt 0)



Will do thank you