0

I am running CentOS 6.6 as VM on VirtualBox with NAT enabled. I also have a zeus web server running on the VM. Setup is the following.

Host =====SSH====== VM  ========= Web Server
MacOS          CentOS 6.6            Zeus

With port forwarding, I can ssh into the VM(port22) and I can access the admin page of zeus web server(port9090). However, when I try to port forward arbitrary numbers like 8080 for a website, browser access or wget don't work.

Host-Port    VM-Port      Connection
2222           22           Works fine
9090          9090          Works fine
8080          8080             ??

I tried using ncat to isolate if the issue stems from zeus web server or port forwarding but the result seems to be a port forwarding issue.

$sudo ncat -lk 9090
GET / HTTP/1.1
User-Agent: Wget/1.18 (darwin15.5.0)
$sudo ncat -lk 8080
#nothing

What should be my next troubleshooting step and does anyone know what I might be doing wrong?

1 Answer 1

0

The issue was caused by linux firewall and zeus configuration. I commented out the one-line that was rejecting all tcp packets for the accept-by-default policy

$sudo cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD 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 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#-A INPUT -j REJECT --reject-with icmp-host-prohibited            #<---THIS ONE
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited\
COMMIT

Then I also changed the Zeus virtual host settings from the follwoing

before
Host Name:127.0.0.1
Alias:

after
Host Name:10.0.2.15
Alias:localhost

10.0.2.15 is the ip address set in the VM by the NAT.

Now I can access the basic index.html on virtual host by typing http://localhost:8080 on my browser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.