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 |
1.I want to change runlevel but the Users shall not be disturbed?how? 2.Disk have 5gb disk utilization even though files unable to create, why? 3.what are the internal and external command in linux? 4.sar command o/p? 5.how list the open files? 6.what is kernel compiling? 7.How do u See complete configuration in ur system? 8.how will u make a daily updates with cron daily? 9.which port is associated with ttys0? 10.specific some problems linux admin(if u are linux admin)faced and how did u overcome it?
10 Answers IBM, TCS,
When u comment the ctrl+alt+del trap in the /etc/inittab save the file. Tell the command to save the changes without rebooting the machine?
What is chainloading?
In Linux how you set time a limit on quota?
Hi All of Unix/Linux professional Q.Why soft link file not open by cat command. Ihave make following symbolic link but when i open with #cat linkfilename it does not oped please see the following code and try to answer. # ln -s file1 ~/mydir/filea [root@dhcppc0 ~]# cd mydir [root@dhcppc0 mydir]# ls -l total 4 lrwxrwxrwx 1 root root 5 2010-04-04 09:04 filea -> file1 [root@dhcppc0 mydir]# cat filea cat: filea: No such file or directory
why do u want to join this company
6 Answers HCL, Infosys, United Healthcare, Wipro,
Does linux cp command overwrite?
What is grep command?
What does (cd dir && command) do?
how to create SAMBA server in fedora 9 linux ?
How do I run bash on windows?
You wish to print the file vacations with 60 lines to a page. Which of the following commands will accomplish this?