I want to built a fire wall using iptables. My condition is
" inbound to 192.168.0.2 with a port of 80 from
172.168.0.1 should accept"
Answers were Sorted based on User's Feedback
Answer / vaithy
iptables -A INPUT -t filter -s 172.168.0.1 -p tcp --sport 80 -d 192.168.0.2 -j ACCEPT
| Is This Answer Correct ? | 25 Yes | 2 No |
iptables -I INPUT -s 172.168.0.1 -p tcp --dport 80 -d 192.168.0.2 -j ACCEPT
| Is This Answer Correct ? | 15 Yes | 0 No |
Command:
iptables -i INPUT -t filter -p tcp -s 172.168.0.1 -d
192.168.0.2 --dport 80 -j ACCEPT
Description:
-i --> Match the INPUT or inbound
-t --> Table name here default is filter
-p --> Protocol
-s --> Source IP
-d --> Destination IP
--dport --> Port number
-j --> Condition.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / ganesh
iptables -A INPUT -s 172.168.0.1 -p tcp --dport 80 -j ACCEPT
AND
iptables -A INPUT -s 192.168.0.2 -p tcp --dport 80 -j REJECT
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / shailesh shinde
iptables -I INPUT -s 172.168.0.1 -p tcp --dport 80 -d
192.168.0.2 -j ACCEPT
iptables -A OUTPUT -m state --state Established,new,Related
-j accept
Both required
| Is This Answer Correct ? | 0 Yes | 0 No |
iptables -t filter -I INPUT -s 192.168.0.2 -P tcp --dport 80
-J ACCEPT
| Is This Answer Correct ? | 2 Yes | 9 No |
What command is used to check the number of files, disk space, and each user’s defined quota?
What are system commands?
What is the command to calculate the size of a folder?
What is filter command in unix?
How do I check my cpu cores?
How do you list all the files in a directory, including hidden files?
What does umask 077 mean?
What does sh do in linux?
When you issue the command ls -l, what signifies the first character of the resulting display file? 701 What command can you use to determine the purpose of any command?
What command should you use to check the number of files and disk space used and each user’s defined quotas?
What are grep patterns called?
What does top do in linux?