LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Blocked out Port 8080 and Port 3306 (https://www.linuxquestions.org/questions/linux-security-4/blocked-out-port-8080-and-port-3306-a-4175562549/)

gamejava 12-28-2015 10:08 PM

Blocked out Port 8080 and Port 3306
 
i can access port 22 and port 80 ..but i am unable to access port 8080 and port 3306
Code:

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i em2 -j ACCEPT
-A INPUT -p tcp -m state -m tcp --dport 22 --state NEW -j ACCEPT
-A INPUT -p tcp -m state -m tcp --dport 80 --state NEW -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT -m comment --comment "Tomcat Server Port"
-A INPUT -p tcp -m state -m tcp --dport 3306 --state NEW -j ACCEPT
-A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -p icmp -j ACCEPT
-A FORWARD -i lo -j ACCEPT
-A FORWARD -i em2 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

can u please guide me

pan64 12-29-2015 09:31 AM

would be nice to explain how did you try that and what did you expect at all?

Habitual 12-29-2015 10:36 AM

Quote:

Originally Posted by gamejava (Post 5470190)
i can access port 22 and port 80 ..but i am unable to access port 8080 and port 3306

Define "access".
Is tomcat (which btw?) running and listening on port 8080?
Is mysql(-server) running and accepting connections from localhost on 3306?
Code:

sudo netstat -natp | grep -e 8080 -e 3306
Some tools/code to try.
Code:

lynx localhost:8080
mysql -uroot -p -h127.0.0.1
telnet 127.0.0.1 3306

Firewall rules work only if there's a listening service/daemon on the host to answer/satisfy the request.

fwNoRules + NoDaemon = No Access
fwRules + NoDaemon = No Access
fwRules + Daemon = Access


All times are GMT -5. The time now is 07:34 AM.