Results 1 to 6 of 6
hi guys
i have one question
suppose the task is : setup a squid proxy server but only allow access for clients in the example.com domain and deny for all ...
- 01-26-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 7
how do i set this rule?
hi guys
i have one question
suppose the task is : setup a squid proxy server but only allow access for clients in the example.com domain and deny for all others.
if i am faced with a situation like that how do i go about putting the rule in iptables? i can easily put
-A RH-Firewall-1-INPUT -p tcp --dport 3128 -j REJECT
but how do i find out what the ip address or range should be for clients in the example.com domain? what command should i type and what should i be putting in the iptables besides the line on top? suppose the ip address are lan
pls help guys....
- 01-26-2010 #2
If its the LAN, then you should all ready know what the IP address range. You will be better off giving iptables a CIDR though:
That is a 255.255.255.0 (aka Class C) range.Code:192.168.0.0/24
For iptables your CIDR would go into the -s or --source whichever option you prefer to use.
- 01-26-2010 #3Just Joined!
- Join Date
- Jan 2010
- Posts
- 7
- 01-27-2010 #4
if you are physically connected to the LAN, and I assume you are running on a linux box, run this command:
you'll have to do this as root, or maybe have to do:Code:ifconfig
you should have results like:Code:sudo /sbin/ifconfig
Take note of your Mask. For me its a Class C so it would be /24. You can google yours to find out your equivalent CIDR if you don't know about subnetting.Code:eth1 Link encap:Ethernet HWaddr 00:1D:09:AC:CB:F8 inet addr:192.168.0.241 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6370 errors:0 dropped:0 overruns:0 frame:0 TX packets:2275 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2689680 (2.5 Mb) TX bytes:434611 (424.4 Kb) Interrupt:17
- 01-28-2010 #5Just Joined!
- Join Date
- Jan 2010
- Posts
- 7
- 01-28-2010 #6
This would drop all traffic coming at the firewall destined for port 25 on that network range.
You wanna allow traffic change the jumper (the -j) to ACCEPT.Code:iptables -A INPUT -p tcp -s 172.24.0.0/16 --dport 25 -j DROP
It really depends on your default chain policy, that would dictate the situation.
e.g.
INPUT DROP
OUTPUT DROP
FORWARD DROP


Reply With Quote
