Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables lookover
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
walterw
Guru
Guru


Joined: 17 Oct 2003
Posts: 464

PostPosted: Sun Aug 19, 2012 5:19 pm    Post subject: iptables lookover Reply with quote

Hi all,

I was wondering if you could give me some feedback regarding my iptables rules. I recently added in support to block some outbound traffic because I believe a laptop running windows may be infected.

I don't believe my outbound traffic is actually being filtered though as perhaps another rule is letting it pass.

Code:

iptables -P OUTPUT DROP


Code:

iptables -A OUTPUT -o eth0 -j ACCEPT
iptables -A OUTPUT -o wlan0 -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 20 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 20 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 123 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 5222 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 68 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 68 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 67 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 67 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 993 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 465 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 1935 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 1935 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --dport 10390 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth1 -p udp --dport 10390 -m state --state NEW,ESTABLISHED -j ACCEPT


My internal interfaces are eth0, wlan0, and eth1 is the external interface.


Walter
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Aug 19, 2012 5:56 pm    Post subject: Reply with quote

Is your Linux PC acting as a router for the laptop? If so, you should be using FORWARD rather than OUTPUT.
Back to top
View user's profile Send private message
walterw
Guru
Guru


Joined: 17 Oct 2003
Posts: 464

PostPosted: Sun Aug 19, 2012 6:14 pm    Post subject: [solved] Reply with quote

Yes, my Linux PC is acting as the gateway for this laptop.

Thanks for pointing that out. After a quick read of the wiki page, I have a better grasp of iptables now.
http://en.wikipedia.org/wiki/Iptables


Thanks,

Walter
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Sun Aug 19, 2012 6:35 pm    Post subject: Reply with quote

correct
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum