Hello,<br><br>I am using the following script to configure iptables on a laptop running Fedora 16. <br><br><br>#!/bin/bash<br>IPTABLES=/sbin/iptables<br>MODPROBE=/sbin/modprobe<br><br>### flush existing rules and set chain policy to DROP<br>
echo "[+] Flushing existing iptables rules..."<br>$IPTABLES -F<br>$IPTABLES -F -t nat<br>$IPTABLES -X<br>$IPTABLES -P INPUT DROP<br>$IPTABLES -P OUTPUT DROP<br>$IPTABLES -P FORWARD DROP<br><br>### load connection tracking modules<br>
echo "[+] Load connection-tracking modules..."<br>$MODPROBE ip_conntrack<br>$MODPROBE iptable_nat<br>$MODPROBE ip_conntrack_ftp<br>$MODPROBE ip_nat_ftp<br><br><br>#### INPUT chain ####<br>echo "[+] Setting up INPUT chain..."<br>
### state tracking rules<br>$IPTABLES -A INPUT -m state --state INVALID -j LOG --log-prefix "DROP INVALID " --log-ip-options --log-tcp-options<br>$IPTABLES -A INPUT -m state --state INVALID -j DROP<br>$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<br>
### ACCEPT rules<br>$IPTABLES -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT<br>$IPTABLES -A INPUT -p icmp --icmp-type echo-request -j ACCEPT<br>### default INPUT LOG rule<br>$IPTABLES -A INPUT -i !lo -j LOG --log-prefix "DROP " --log-ip-options --log-tcp-options<br>
<br><br>#### OUTPUT chain ####<br>echo "[+] Setting up OUTPUT chain..."<br>### state tracking rules<br>$IPTABLES -A OUTPUT -m state --state INVALID -j LOG --log-prefix "DROP INVALID " --log-ip-options --log-tcp-options<br>
$IPTABLES -A OUTPUT -m state --state INVALID -j DROP<br>$IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<br>### ACCEPT rules for allowing connections out<br>$IPTABLES -A OUTPUT -p tcp --dport 21 --syn -m state --state NEW -j ACCEPT<br>
$IPTABLES -A OUTPUT -p tcp --dport 22 --syn -m state --state NEW -j ACCEPT<br>$IPTABLES -A OUTPUT -p tcp --dport 25 --syn -m state --state NEW -j ACCEPT<br>$IPTABLES -A OUTPUT -p tcp --dport 43 --syn -m state --state NEW -j ACCEPT<br>
$IPTABLES -A OUTPUT -p tcp --dport 80 --syn -m state --state NEW -j ACCEPT<br>$IPTABLES -A OUTPUT -p tcp --dport 443 --syn -m state --state NEW -j ACCEPT<br>$IPTABLES -A OUTPUT -p tcp --dport 4321 --syn -m state --state NEW -j ACCEPT<br>
$IPTABLES -A OUTPUT -p udp --dport 53 -m state --state NEW -j ACCEPT<br>$IPTABLES -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT<br>### default OUTPUT LOG rule<br>$IPTABLES -A OUTPUT -o !lo -j LOG --log-prefix "DROP " --log-ip-options --log-tcp-options<br>
<br><br>#### FORWARD chain ####<br>echo "[+] Setting up FORWARD chain..."<br>### state tracking rules<br>$IPTABLES -A FORWARD -m state --state INVALID -j LOG --log-prefix "DROP INVALID " --log-ip-options --log-tcp-options<br>
$IPTABLES -A FORWARD -m state --state INVALID -j DROP<br>### default log rule<br>$IPTABLES -A FORWARD -i !lo -j LOG --log-prefix "DROP " --log-ip-options --log-tcp-options<br><br><br>After enabling the configuration and rebooting, I am able to login and use the laptop in text mode, but not able to login in graphic mode. <br>
<br>Would you be able to tell me how to tweak the script so that it will allow me to login in graphic mode as well? <br><br><br>Regards,<br>Andrei.<br><br>