A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label ports. Show all posts
Showing posts with label ports. Show all posts

VirtualBox commands


VBoxManage showvminfo [appliance name] |grep NIC

NIC 1 Rule(0):   name = AMQ admin page, protocol = tcp, host ip = 127.0.0.1, host port = 6666, guest ip = , guest port = 8161
NIC 1 Rule(1):   name = PRL, protocol = tcp, host ip = 127.0.0.1, host port = 5555, guest ip = , guest port = 5000
NIC 1 Rule(2):   name = SSH, protocol = tcp, host ip = 127.0.0.1, host port = 2222, guest ip = , guest port = 22
NIC 1 Rule(3):   name = XT, protocol = tcp, host ip = 127.0.0.1, host port = 8888, guest ip = , guest port = 8529
NIC 1 Rule(4):   name = web, protocol = tcp, host ip = 127.0.0.1, host port = 8080, guest ip = , guest port = 80

Working with iptables on Redhat linux

iptables is the default firewall software on Redhat Linux

Display a list of ports it's restricting:
sudo /sbin/iptables -L

This is what it looks like when it's not restricting anything:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


If it doesn't look like that and you need to open a port, edit this file:
/etc/sysconfig/iptables

It might look something like this:

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT


Add the line in bold above to open up port 80.

Restart like this:
/etc/init.d/iptables restart