You are not logged in.

#1 2012-05-22 06:28:36

tlq
Member
Registered: 2012-05-22
Posts: 14

[SOLVED] can't open port

Hello all.
I make this
# iptables -A INPUT -p tcp --dport 555 -j ACCEPT
and port is closed still(it's okay with port forwarding on router). what should i do? thank you.

Last edited by tlq (2012-05-22 16:52:16)

Offline

#2 2012-05-22 07:03:43

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] can't open port

What makes you think the port's still "closed"? What's listening on that port (which service)?


Burninate!

Offline

#3 2012-05-22 07:24:04

tlq
Member
Registered: 2012-05-22
Posts: 14

Re: [SOLVED] can't open port

There is my php-daemon on this port. I can't connect to port by telnet, www.canyouseeme.org can't too.
ps
this daemon perfectly works on two other machines(on centos).

Last edited by tlq (2012-05-22 07:26:16)

Offline

#4 2012-05-22 07:29:38

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] can't open port

Can you telnet to the daemon locally (telnet localhost 555)?


Burninate!

Offline

#5 2012-05-22 07:43:40

tlq
Member
Registered: 2012-05-22
Posts: 14

Re: [SOLVED] can't open port

No, I can't. What 'iptables -nvL' gives

Chain INPUT (policy ACCEPT 212 packets, 22390 bytes)
pkts bytes target     prot opt in     out     source               destination
    6   304 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:555

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 197 packets, 19519 bytes)
pkts bytes target     prot opt in     out     source               destination

Offline

#6 2012-05-22 07:49:00

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] can't open port

Ok, if you can't connect locally then there's no need to worry about portforwarding etc yet.

Could you post the output of the following?

# ip addr
# ss -a

Burninate!

Offline

#7 2012-05-22 07:51:58

tlq
Member
Registered: 2012-05-22
Posts: 14

Re: [SOLVED] can't open port

[root@myhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:15:58:8e:6c:88 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.111/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::215:58ff:fe8e:6c88/64 scope link
       valid_lft forever preferred_lft forever
[root@myhost ~]# ss -a
State       Recv-Q Send-Q          Local Address:Port              Peer Address:Port
LISTEN      0      5                           *:ftp                          *:*
LISTEN      0      0                           *:50422                        *:*
LISTEN      0      128                        :::ssh                         :::*
LISTEN      0      128                         *:ssh                          *:*
LISTEN      0      50                          *:mysql                        *:*
LISTEN      0      128                        :::http                        :::*
ESTAB       0      0               192.168.1.111:mysql             83.244.244.4:51239
ESTAB       0      0               192.168.1.111:51239             83.244.244.4:mysql
ESTAB       0      52              192.168.1.111:ssh               83.244.244.4:54365
ESTAB       0      0               192.168.1.111:ftp               192.168.1.51:60324

Ok, if you can't connect locally then there's no need to worry about portforwarding etc yet.

okay. but port 555 is still forwarded to 192.168.1.111

Last edited by tlq (2012-05-22 07:53:32)

Offline

#8 2012-05-22 08:03:19

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] can't open port

Unless I'm overlooking something (it's still relatively early in the morning here), you don't seem to have anything listening on port 555.


Burninate!

Offline

#9 2012-05-22 08:33:23

tlq
Member
Registered: 2012-05-22
Posts: 14

Re: [SOLVED] can't open port

Hah big_smile On these listings daemon doesn't working. I turned on the daemon, and there is strange string in listing:

[root@myhost ~]# ss -a
State      Recv-Q Send-Q                               Local Address:Port                                   Peer Address:Port
LISTEN     0      5                                                *:ftp                                               *:*
LISTEN     0      128                                             :::ssh                                              :::*
LISTEN     0      128                                              *:ssh                                               *:*
LISTEN     0      50                                               *:mysql                                             *:*
LISTEN     0      10                                   192.168.1.111:dsf                                               *:*
LISTEN     0      128                                             :::http                                             :::*
FIN-WAIT-1 0      1                                    192.168.1.111:ssh                                    85.26.231.66:etb4j
TIME-WAIT  0      0                                    192.168.1.111:ftp-data                                192.168.1.51:63002
ESTAB      0      232                                  192.168.1.111:ssh                                    83.244.244.4:62319
ESTAB      0      0                                    192.168.1.111:ssh                                    83.244.244.4:54365
TIME-WAIT  0      0                                    192.168.1.111:ftp-data                                192.168.1.51:62997
ESTAB      0      0                                    192.168.1.111:ftp                                    192.168.1.51:62313

What does it mean, :dsf? :-|

Offline

#10 2012-05-22 08:41:09

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] can't open port

You can use the "-n" flag so it doesn't resolve service names. So "ss -an".


Burninate!

Offline

#11 2012-05-22 08:59:25

tlq
Member
Registered: 2012-05-22
Posts: 14

Re: [SOLVED] can't open port

Thank you very much. I found the problem, it was beacause of php wink.

Offline

#12 2012-05-22 09:38:57

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] can't open port

Good to hear it's working.

Don't forget to mark your thread as [SOLVED].


Burninate!

Offline

Board footer

Powered by FluxBB