Skip to main content

IPCOP - How to block IP address's, ranges etc...

More
19 years 3 months ago #9614 by DaLight
I'm a Hatton fan myself. :D :D Hope you get on OK with everything.
More
13 years 10 months ago #35939 by stevied81
Replied by stevied81 on topic IPCOP IPTable
Hi Guys

Newbie here.

I am trying to add this IP range to our IPCOP IPTABLES List. I have SSH'd in and can see the current list. However I do not know the command to add to it.

The IP range I want to add is 10.14.0.0/24

I have attached our current list that I want to add to. Thanks so much !

current looks similar to this

ACCEPT all -- 10.10.0.0/24 anywhere
More
13 years 10 months ago #35940 by DaLight
Edit your rc.local file which should have the following path:

/etc/rc.d/rc.local

and add the following line:

[code:1]
#allow full access for specific IPs
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 10.14.0.0/24 -o $RED_DEV -j ACCEPT
[/code:1]
More
13 years 10 months ago #35941 by stevied81
Thank you !

I can get to that directory (in SSH) but not sure how to open/edit the file? save etc? Thanks
More
13 years 10 months ago #35942 by DaLight
If you're not accessing via a GUI-based SSH tool, you will need to know how to use "vi", the built-in text editor:

1. Go to directory.
2. type (without quotes) "vi rc.local"
3. Move to the line where you wish to start editing
4. Type (without quotes) "i" to enter edit mode. (Case important)
5. Start adding text
6. Type (without quotes) "ESC"
7. Type (without quotes) ":wq" to save and quit vi.

At the command prompt, enter the following command to update the changes otherwise you would have to restart your IPCOP box.
[code:1]./rc.local[/code:1]
More
13 years 10 months ago #35943 by stevied81
Hi

I get as far as number 5. I enter the text. Then the ESC and :wq either get inserted as text or if i hit the esc button then it leaves edit mode and doesnt allow any other commands as there is no command prompt?
Time to create page: 0.140 seconds