Quantcast
Channel: Admins Goodies » port
Viewing all articles
Browse latest Browse all 10

How to open UDP port 7777 from iptables/firewall on Ubuntu 11.04

$
0
0

Question

I need to enable the port 7777 from my VPS which runs Ubuntu 11.04, I have added rules from the iptables which is listed here,

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere            udp dpt:7777 Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere            udp dpt:7777 Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere            udp dpt:7777 

However, when I telnet to port 7777, it says connection refused from my side, telnet xx.xx.xx.xx 7777, even if I telnet on the server with telnet localhost 7777.

How should I effectively open it to allow connections to port 7777 to my server?

Answer

telnet uses TCP. If there is no TCP listener on the port you specify, then the connection request will be refused. Try using nc instead:

$ nc -zu <IP> 7777
$ echo $?
0

Exit status 0 returned means that this port is open.

or nmap:

$ sudo nmap -p 7777 -sU -P0 <IP>

for e.g:

$ sudo nmap -p 9 -sU -P0 192.168.6.142Starting Nmap 5.51 ( http://nmap.org ) at 2012-08-30 21:31 ICT
Nmap scan report for (192.168.6.142)
Host is up.
PORT  STATE         SERVICE
9/udp open|filtered discardNmap done: 1 IP address (1 host up) scanned in 2.12 seconds
Answered by quanta

Viewing all articles
Browse latest Browse all 10

Trending Articles