Quote:
Originally Posted by bowens44
When I use this, and do an iptables -L for this line it says:
ACCEPT all -- anywhere anywhere
|
The reason it says "anywhere anywhere" is because there are no source or destination IP addresses specified in the rule. If you tell it to be verbose with the
-v option, it will also list (among other things) the interface this rule applies to if it is restricted to a particular interface. And the interface (loopback aka lo) is the
only thing the rule I gave you specified. The loopback interface is how the computer "talks to itself" using addresses 127.xx.xx.xx, most frequently the address 127.0.0.1. When I list
iptables rules I like to use specify the options
-nvL. In addition to being verbose, it lists address and ports numerically. This is a matter of personal taste and you can obviously do as you wish.
Quote:
I don't know exactly. I'm new to this. I got this from a web site that told how to build a basic iptables setup. It said that this allowed any traffic from localhost.
|
To my knowledge the advice is wrong. If you can provide a link where you got that, maybe I or somebody else can comment further on it.
Since you are learning, you might want to take a look at the
LQ Wiki article for configuring a basic workstation firewall The firewall listed there uses the localhost address instead of the loopback interface like the rule I showed you. Personally I think you're better of referring to the interface, but if you use decide you wish to use the address I suggest using the range of addresses 127.0.0.0/8 instead of the single address 127.0.0.1.
Edit: I am not sure I was detailed enough in explaining why the rule fixed things. On the remote machine, there is a "proxy X server" running which to your application looks like a real X server. Your application needs to communicate to the proxy server over the loopback interface using the address of localhost (127.0.0.1). Your original rules did not allow these packets to flow. The rule I gave accepts all packets on the loopback interface, so these packets are allowed to flow.