help with iptables


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers help with iptables
# 1  
Old 10-12-2011
help with iptables

Hi,

On the IPTABLES, I did iptables --flush. I want to start fresh. Now I only want two things. Allow one ip address to this server. Allow port 443 as incoming from every where. Please advice how to do this.

This is what I did so for.

Code:
 
iptables -I INPUT -i eth0 -s 1.2.3.4 -j ACCEPT
 
iptables -I INPUT -m state -dport 443 -j ACCEPT

second iptables command didn't work. Please let me know
# 2  
Old 10-12-2011
In what way did it "not work", please explain what it printed and what happened after.
# 3  
Old 10-12-2011
First one worked. But I want to check with you guys make sure I have it correctly. But second one I get this err.msg.
Code:
 
 
# iptables -I INPUT -m state -dport 443 -j ACCEPT
Bad argument `443'
Try `iptables -h' or 'iptables --help' for more information.

# 4  
Old 10-12-2011
Check man iptables and you'll see it's --dport, not -dport.
# 5  
Old 10-12-2011
Code:
 iptables -I INPUT -m state --dport 443 -j ACCEPT
iptables v1.4.7: unknown option `--dport'
Try `iptables -h' or 'iptables --help' for more information

.


I am reading the man iptables. not sure what I am doing wrong. I don't see any example. Any one who can hlep me ?

---------- Post updated at 12:31 PM ---------- Previous update was at 12:23 PM ----------

I think I got it. not sure why i need the -m state. I did this and worked.

Code:
iptables -A INPUT -p tcp --dport 443 -j ACCEPT

Just want to check with other expert, is this correct.
# 6  
Old 10-12-2011
Those two rules appear to do what you want.

They should be followed by a rule which rejects everything, otherwise it might just default-accept everything though.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

iptables

Hi I need help with an iptables configuration, this is what I have server A Server B A and B are using different gateways i am sending port 22 from A to B, I see the packages coming in B but B is not sending the package to internet. please give me some examples. (0 Replies)
Discussion started by: lmartinez073
0 Replies

2. Red Hat

iptables help for port 80

Hi I enable the IPtables but port 80 was not working. Below is my active configuration (10 Replies)
Discussion started by: ranjancom2000
10 Replies

3. IP Networking

Help with iptables

photo... (1 Reply)
Discussion started by: beerpong1
1 Replies

4. UNIX for Dummies Questions & Answers

Help with iptables

Hi, I just build a Linux server, I said yes to enable the firewall. I only choose SSH conneciton. When I check the iptables. I see all of this (see below). I want to reject every thing only allow SSH from subnet 192.168.1.xx. Can you advise, how to do. Chain RH-Firewall-1-INPUT (2... (2 Replies)
Discussion started by: samnyc
2 Replies

5. IP Networking

iptables changes

Hello We have one linux machine in the office which happens to be an important firewall. I just know the basics and need to make one change Essentially it is forward mysql traffic to another internal machine. This is the original rule (forward to 192.20.0.17) which is working ... (0 Replies)
Discussion started by: rina5392
0 Replies

6. IP Networking

Iptables

What should be the iptables rule so that only the subnet 64.61.11.224/255.255.255.248 may access the mysql port 3306 (1 Reply)
Discussion started by: proactiveaditya
1 Replies

7. IP Networking

iptables assistance

I have a CentOS 5.2 (10.20.21.73) machine that I need help with configuring iptables. According to documentation I believe this line should allow all communication between my machine and another machine (other machine has no firewall) -A RH-Firewall-1-INPUT -s 10.20.21.12 -j ACCEPT #... (1 Reply)
Discussion started by: beaker457
1 Replies

8. IP Networking

Iptables

Thanks in advance I have to remove ip_tables_name from /proc/net/... i was trying to do so and getting the following error cmd : rm ip_tables_names error : rm: remove regular empty file `ip_tables_names'? y rm: cannot remove `ip_tables_names': Operation not permitted (4 Replies)
Discussion started by: sudeepiit
4 Replies

9. IP Networking

Need help with iptables

Trying to create a whitelist to limit bandwidth. My sync speed is 1536/256 kbps. Simple rules in order: 1. Do not limit (or set to 1536/256) MAC 00:00:00:00:00 (computer is in 192.168.1.0/24). 2. Do not limit (or set to 1536/256) MAC 00:00:00:00:01 (computer is in 192.168.1.0/24). 3. Do not... (1 Reply)
Discussion started by: kripz
1 Replies

10. IP Networking

IPtables

Hey guys, I have just started using IP tables and was wondering if anyone could direct me to any good online resources as I am totally new to this. Thanks. (1 Reply)
Discussion started by: 182x
1 Replies
Login or Register to Ask a Question