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



I want to built a fire wall using iptables. My condition is " inbound to 192.168.0.2 with ..

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

I want to built a fire wall using iptables. My condition is " inbound to 192.168.0.2 with ..

Answer / manoj samtani

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

I want to built a fire wall using iptables. My condition is " inbound to 192.168.0.2 with ..

Answer / venkat

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

I want to built a fire wall using iptables. My condition is " inbound to 192.168.0.2 with ..

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

I want to built a fire wall using iptables. My condition is " inbound to 192.168.0.2 with ..

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

I want to built a fire wall using iptables. My condition is " inbound to 192.168.0.2 with ..

Answer / sri krishna

iptables -t filter -I INPUT -s 192.168.0.2 -P tcp --dport 80
-J ACCEPT

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More Linux Commands Interview Questions

Which command is used to compare the files?

0 Answers  


What does the top command display?

10 Answers   iNautix, Yahoo,


What is the ipconfig command for linux?

0 Answers  


What is the symbol of linux?

0 Answers  


When and how linux developed?

0 Answers  






How does diff command work?

0 Answers  


Is makefile a shell script?

0 Answers  


My machine is running half duplex mode how to change half duplex to full duplex?

4 Answers   Oracle,


Why is it called bash?

0 Answers  


How do you rate yourself in unix(if 0 is novice and 10 is sys admin)?

2 Answers   HP,


A file which is not deleted by normal user and also root (using rm), for that type of file how we delete it?

5 Answers   CTS,


Did you ever write any inerface files / profile file to support unix environment setup ?

1 Answers   HP,


Categories