Blocking all remote IP addresses except one IP (on home net)

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
webman
Forum Newbie
Posts: 13
Joined: Thu May 27, 2010 8:20 am

Blocking all remote IP addresses except one IP (on home net)

Post by webman »

I am using OpenSUSE (latest). I have Apache2 on and I want to run a ftp server. I have configured Apache2 to allow incoming connections only from a particular IP which is on my home network (192.168.2.102). But it looks like it is more difficult to do this on the ftp server (pure-ftpd). So I want to ask if it is possible to configure my entire system to block remote access from ALL ip addresses except the one on my home network (specified above).

How to do that ?!
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Blocking all remote IP addresses except one IP (on home

Post by Celauran »

Use iptables to block 0.0.0.0/0 and only allow 192.168.0.102
webman
Forum Newbie
Posts: 13
Joined: Thu May 27, 2010 8:20 am

Re: Blocking all remote IP addresses except one IP (on home

Post by webman »

Celauran wrote:Use iptables to block 0.0.0.0/0 and only allow 192.168.0.102
Thanks for the compact info. I have looked into how to configure that thing (there is a file special for custom rules for the OPenSUSE firewall). The files specifies those iptables...

Of course, I need to learn more now about iptables. I guess I will need to define two lines there a. the one that blocks all and then b. the one that allows that particular ip.
webman
Forum Newbie
Posts: 13
Joined: Thu May 27, 2010 8:20 am

Re: Blocking all remote IP addresses except one IP (on home

Post by webman »

Thanks. Mission accomplished! No further assistance is needed :)
Post Reply