Sponsored Content
Operating Systems Linux Red Hat iptables applied in local machine, can't ssh remote machine after chain changed to DROP Post 302904569 by Aia on Wednesday 4th of June 2014 09:22:59 PM
Old 06-04-2014
The rules pertaining the connection from 192.168.1.99 to destination port 22 on 192.168.1.15 are:
Quote:
iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
And they should be adequate to allow access to 192.168.1.15

What are the lines order of them?
Please, post the output of iptables -L -n --line-number
This User Gave Thanks to Aia For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

[FTP]opying of file from remote to local machine

Hi All, i wannna copy a file from the remote machine to my local machine using FTP protocol. i have made a connection to the remote machine , then i used the "get" cmd to copy the remote file as below :-> ftp> get (remote-file) /home/aruba/opmtools/was50/Was5Install.doc (local-file)... (1 Reply)
Discussion started by: sonbag_pspl
1 Replies

2. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

3. Shell Programming and Scripting

check web server running on local and on remote machine

Hi , How to check whether web server is running from remote machine How to check whether web server is running on web server itself Can any one help me soon (1 Reply)
Discussion started by: satheeshkr_cse
1 Replies

4. Shell Programming and Scripting

Define local variable on remote machine ?

Hello, I'm executing many commands using ssh and I want to define local vars on remote machine to ease my work: ssh remote1 <<-heredoc1 cmd1 cmd2 ... heredoc1 This one obviously defines variable on local machine: ssh remote1 "x=10" This one returns: ssh remote1 "'x=10'" bash: x=10:... (1 Reply)
Discussion started by: vilius
1 Replies

5. Shell Programming and Scripting

Using local variable on a remote machine

Hi, I'm writing a korn shell script where the user enters a variable and I have to create a directory remotely which contains the name of that variable. Example. print 'Please enter variable:' read variable ssh user@host 'mkdir before_$variable;' Thank you. (4 Replies)
Discussion started by: jangozo
4 Replies

6. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

7. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

8. Linux

Executing a script in remote machine through ssh

How to execute a script in remote machine through ssh I have a script test.sh which does some backup activity in remote machine. Wanted to keep backup also in remote machine. ssh -l username <remote machine> "commands to be exceuted as ; separted" but how to put the script in the place of... (5 Replies)
Discussion started by: sanvel
5 Replies

9. Shell Programming and Scripting

Help with fetching the data from remote machine from my jumpbox(local machine)

Team, Presently i am running a script from my local box(i.e jumpbox) to all the remote machines.Basically fetching basic queries like pwd,mkdir,touch etc and i am able to successfully fetch it from my local machine.But when i want to check certain database related queries like the dbstat... (20 Replies)
Discussion started by: whizkidash
20 Replies

10. Shell Programming and Scripting

How can I execute local script on remote machine and include arguments?

I have a script in local server cd /home/dell/work/BOP/testdir ./processchk po (here processchk is a script & po is passed as an argument) Now I want to execute this script from remote server ssh $username@$hostname "cd /home/dell/work/BOP/testdir; ./processchk po" But Its getting error... (9 Replies)
Discussion started by: manohar2013
9 Replies
FILTER 
SYNTAX(5) File Formats Manual FILTER SYNTAX(5) NAME
rules.filter - Input format for filtergen packet filter compiler INTRO
This file describes the input syntax accepted by filtergen(8). BASICS
In general form, a filter rule is described by a direction, an interface, a target and (possibly empty) sets of matches and options. Simple rules will look like: direction interface match0 .. matchN target; for example: input eth0 source host1 dest host2 proto tcp dport http accept; Note that the elements of the rule can be placed in any order, with the exception that the interface must immediately follow the direction. Thus, this rule is equivalent to the above (though perhaps less readable): proto tcp source host1 dport http accept dest host2 input eth0; The semicolon separates rules. It is optional before a closing brace or the end of a file. Whitespace is not significant. Anything after a hash ("#") on a line is ignored. DIRECTION A direction merely specifies whether to match packets being sent or received. The only two directions available are "input" and "output". Forwarded packets will pass through both, INTERFACE This specifies which real or virtual network device to filter. As far as filtergen is concerned, this is just a text string. It must be the same as the device name on the target system. Common names on Linux are "eth0", "eth1", ..., "ppp0", etc. Other systems will have different naming rules. TARGET A target notes what we do with a matching packet. Universal options are accept and drop which, respectively, state that the packet should be allowed as normal, or thrown away. Some backends support reject to throw away a packet, but send notification to the sender that it was denied, masq (on output rules only) to "masquerade" a packet - alter it so that it appears to come from the address of the sending inter- face - and proxy (and its deprecated alias redirect) to divert a connection via the local system. MATCHES The matches are the meat of the rule. They apply a set of tests to a packet and decide if this rule will be used to process it. Available matches are: source addr-range dest addr-range proto {tcp|udp|icmp|...} sport port-range dport port-range icmptype icmp-type Matches can be negated by prefixing them with a "!": input eth0 ! dest 10.0.0.3 reject; (note than not all backends can support this). OPTIONS Options affect the behaviour of the matcher or the target. Currently implemented are log, which logs packets, local, which means only to check packets to or from this interface, forward which means the opposite of local, and oneway which causes the backend to omit rules which permit return packets. The log option can optionally specify a message to log matching packets with, where the backend supports it: input eth0 source { 10.0.0.0/8 192.168.0.0/16 } log text "private addresses" drop; Note that the oneway option make have no effect when used with the -l command-line flag on backends which support it. GROUPING
Because it can get tedious to type: input eth0 source foo dest bar proto tcp dport http accept; input eth0 source foo dest bar proto tcp dport https accept; input eth0 source foo dest bar proto tcp dport nntp accept; input eth0 source foo dest bar proto tcp sport 1:1023 dport ssh accept; ... filter allows you to group rules with a set syntax: input eth0 source foo dest bar proto tcp { dport http; dport https; dport nntp; sport 1:1023 dport ssh; } accept; Matches which accept arguments can also be grouped: input eth0 source foo dest bar proto tcp { dport {http https nntp}; sport 1:1023 dport ssh; } accept; OUT-OF-LINE GROUPS It is commonly the case that both hosts and routers have long lists of similar looking rules to allow traffic between groups of hosts, as above. What if we had another pair of hosts which needed a variety of services? We could simply put the rule groups one after the other: input eth0 source foo dest bar proto tcp { dport {http https nntp}; sport 1:1023 dport ssh; } accept; input eth0 source baz dest quux proto tcp { dport {1264 1521 1984 8008 8080 26000}; } accept; The above generates 11 rules, and every additional port adds another rule through which packets will pass (well, ones which don't match any of the above). The first four output rules have the same source and destination hosts and protocol, and we know that if it doesn't match those on the first rule, it won't on the next three, either. Out-of-line groups use this fact to streamline things somewhat: input eth0 source foo dest bar [ proto tcp { dport {http https nntp}; sport 1:1023 dport ssh; } accept; ]; input eth0 source baz dest quux [ proto tcp { dport {1264 1521 1984 8008 8080 26000}; } accept; ]; Where the underlying system supports it, everything inside the square brackets is moved into a separate "chain" (in ipchains and iptables- speak) or "group" (in ipfilter-speak). Thus, any packet not matching "source foo dest bar" or "source baz dest quux" above will be checked against only two rules, not eleven. Note that matches which must appear together, like "proto tcp" and "sport 12345" need to be either both in the group, or both out of it. EXAMPLE
Here's a fairly complete example, for a single-interface machine: # # Example filter for (for example) a mail server # # Unfortunately, we don't have time to audit the # communications which go on locally {input lo; output lo} accept; # But we want to be a bit more careful when speaking # to the outside world input eth0 { # Sadly, we share a DMZ with Windows machines. # Don't log their netbios noise proto {tcp udp} source ournet/24 dport 137:139 drop; proto tcp { dport { smtp pop-3 } accept; dport ssh source ournet/24 accept; # We don't answer this, but don't want to # cause timeouts by blocking it dport auth reject; log drop; }; # We don't run any UDP (or other non-TCP) # services log drop; }; output eth0 { proto tcp { dport { smtp auth } accept; log drop; }; # Outbound DNS is OK proto udp dport domain dest { ns0 ns1 } accept; log drop; }; SEE ALSO
filtergen(8), filter_backends(7) January 7, 2004 FILTER SYNTAX(5)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy