Linux IPTABLES help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Linux IPTABLES help
# 1  
Old 06-18-2005
Linux IPTABLES help

I'm new to Linux and I made a big mistake at work recently locking myself out of our own server Smilie.

I did iptables -F first as the tutorial said and then entered the rules. I wanted to start over again so I did iptables -F and it locked us out. We had to get someone to physically restart iptables before we could get back in.

Any idea why the second iptables -F locked me out and how to avoid it and know when it will flush everything and when it will lock out?

Thanks

I used some rules I saw in a tutorial as follows:
iptables -F
iptables -A INPUT -I lo -p all -j ACCEPT
iptables -A OUTPUT -o lo -p all -j ACCEPT
iptables -A INPUT -I eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --tcp-option ! 2 -j REJECT --reject-with tcp-reset
iptables -A INPUT -p tcp -I eth0 --dport 22 -j ACCEPT
iptables -A INPUT -p udp -I eth0 --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -I eth0 --dport 80 -j ACCEPT
iptables -A INPUT -p udp -I eth0 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -I eth0 --dport 53 -j ACCEPT
iptables -A INPUT -p udp -I eth0 --dport 53 -j ACCEPT
iptables -P INPUT DROP
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Debian

Linux outbound traffic filtering with: cgroups + tc + iptables

I spent a lot of time trying to implement outbound traffic filtering with: cgroups + tc + iptables on Debian Jessie. Unfortunately there is still something wrong. The biggest issue is: - cgroups install + config - net_cls subsystem implementation - packets marking with net_cls - appropriate... (0 Replies)
Discussion started by: Novi
0 Replies

2. Homework & Coursework Questions

iptables producing 'Unknown error 18446744073709551615' inRed Hat Enterprise Linux Server 5.5

Creating a large number of rules such as 100000, iptables will produce errors after 42000 rules "iptables: Unknown error 18446744073709551615". But another machine where i have debian virtual machine I can easily run the sciprt of 100000 of rules I am waiting for your reply 4.... (1 Reply)
Discussion started by: tahirfattani
1 Replies

3. UNIX for Dummies Questions & Answers

Linux iptables -> is it possible?

Hi! I have a dedicated hosting working with 2 ips. Is it possible to block all connections but 1 in all existing ports for only 1 of my ips? I mean like, I have 2 ips for example: 190.x.x.5 and 190.x.x.6 I want that all the connections going to 190.x.x.6 in all ports get rejected but only 1... (7 Replies)
Discussion started by: Kekox
7 Replies

4. Cybersecurity

Replace Sonicwall with linux box using iptables

Hello, I am currently using a Sonicwall firewall to protect a class C network of public IP addresses. The sonicwall allows me to specify which IP's will be on the DMZ port and the remainder are on the LAN port by default. I would like to replace this Sonicwall with a linux box and use iptables... (3 Replies)
Discussion started by: richard987
3 Replies

5. Cybersecurity

[Linux] Blocking Your w00tw00ts with iptables

I noticed a few w00tw00ts in our Apache2 logfile the other day, so I thought I would write a quick post on blocking them with iptables. Feel free to improve upon any of my scripts or ideas in this thread. First of all, what is a w00tw00t and where might we find one? Well, a w00tw00t is an... (10 Replies)
Discussion started by: Neo
10 Replies

6. Cybersecurity

Help needed in IPTables firewall/router setup - Linux

HI all, I have setup IPTables firewall/Router and my home network, with address space 192.168.10.XXX Form my private network hosts, i can ping the gateway ( 192.168.10.101 ) , but the reverse is not happening. Can someone help me as of what i need to do, so that i can ping my private... (1 Reply)
Discussion started by: chandan_m
1 Replies

7. Linux

LINUX 9 IPTABLES and DNS

I have installed a linux 9 router/firewall and have issues with outside DNS queries making it in. here are my IPTABLE rules, can anyone make some suggestions? ETH1 is my outside facing Interface, ETH0 is my inside facing interface. Accept If input interface is not eth1 Accept If protocol... (6 Replies)
Discussion started by: frankkahle
6 Replies

8. UNIX for Advanced & Expert Users

LINUX 9 IPTABLES and DNS

I have installed a linux 9 router/firewall and have issues with outside DNS queries making it in. here are my IPTABLE rules, can anyone make some suggestions? ETH1 is my outside facing Interface, ETH0 is my inside facing interface. Accept If input interface is not eth1 Accept If protocol is... (1 Reply)
Discussion started by: frankkahle
1 Replies

9. UNIX for Dummies Questions & Answers

how to configure a linux box as a firewall using iptables

I have already compiled the kernel and configured it to run as a firewall. My computer has 2 NICs and is on two seperate networks. I can ping both networks from my computer, but workstations on one network can not ping workstations on the other. What Scripts or commands do I need to install ? (2 Replies)
Discussion started by: Deuce
2 Replies
Login or Register to Ask a Question
IPTABLES-SAVE(8)						  iptables 1.6.1						  IPTABLES-SAVE(8)

NAME
iptables-save -- dump iptables rules to stdout ip6tables-save -- dump iptables rules to stdout SYNOPSIS
iptables-save [-M modprobe] [-c] [-t table] ip6tables-save [-M modprobe] [-c] [-t table] DESCRIPTION
iptables-save and ip6tables-save are used to dump the contents of IP or IPv6 Table in easily parseable format to STDOUT. Use I/O-redirect- ion provided by your shell to write to a file. -M, --modprobe modprobe_program Specify the path to the modprobe program. By default, iptables-save will inspect /proc/sys/kernel/modprobe to determine the exe- cutable's path. -c, --counters include the current values of all packet and byte counters in the output -t, --table tablename restrict output to only one table. If not specified, output includes all available tables. BUGS
None known as of iptables-1.2.1 release AUTHORS
Harald Welte <laforge@gnumonks.org> Rusty Russell <rusty@rustcorp.com.au> Andras Kis-Szabo <kisza@sch.bme.hu> contributed ip6tables-save. SEE ALSO
iptables-apply(8),iptables-restore(8), iptables(8) The iptables-HOWTO, which details more iptables usage, the NAT-HOWTO, which details NAT, and the netfilter-hacking-HOWTO which details the internals. iptables 1.6.1 IPTABLES-SAVE(8)