homepage Welcome to WebmasterWorld Guest from 54.237.54.83
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Iptables
Iptables
dcool86




msg:4419863
 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

 

lammert




msg:4419870
 4:44 am on Feb 21, 2012 (gmt 0)

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

dcool86




msg:4419874
 5:03 am on Feb 21, 2012 (gmt 0)

I forgot to mention the OS it's ubuntu 11.10 sorry

dcool86




msg:4419875
 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!

lammert




msg:4419878
 5:35 am on Feb 21, 2012 (gmt 0)

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.

dcool86




msg:4419879
 5:38 am on Feb 21, 2012 (gmt 0)

Will do thank you

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved