[WorksForMe] NAT not working
Posted: 30. Oct 2019, 05:12
Can't connect to webserver on guest anymore. How to fix?
Ubuntu 16.04 guest server on 18.04 host Desktop.
The VM guest is set up with Apache for testing websites.
Has not been used for a while. Was working several months ago. Only difference is updates, not version upgrades, on both guest and host.
VM adapter is connected to host via NAT. NAT is port forwarding several ports. Firewall, ufw, is disabled on host and guest.
The NAT settings are:
NOTE: "host ip" was empty and I changed it to 127.0.0.1 attempting to get web connections working. ssh works regardless whether "host ip" has a value.
The guest is accessible from the host over ssh with either of the following commands...
The Apache server is NOT accessible from the host with any of the following commands...
The Apache server IS running on the guest...
The Apache server IS accessible on the guest with the following commands...
But it can't be accessed with...
On the guest, netstat doesn't show the Apache server listening on IPv4 port 80, even while links2 is connected by guest:~$ links2 127.0.0.1 in a separate terminal. IPv6 port 80 is shown as listening though...
Suggestions please.
Ubuntu 16.04 guest server on 18.04 host Desktop.
The VM guest is set up with Apache for testing websites.
Has not been used for a while. Was working several months ago. Only difference is updates, not version upgrades, on both guest and host.
VM adapter is connected to host via NAT. NAT is port forwarding several ports. Firewall, ufw, is disabled on host and guest.
The NAT settings are:
Code: Select all
host:~$ VBoxManage showvminfo "TestDevLAMP"
...
NIC 1: MAC: ************, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0): name = SSH, protocol = tcp, host ip = 127.0.0.1, host port = 2224, guest ip = , guest port = 22
NIC 1 Rule(1): name = SSL, protocol = tcp, host ip = 127.0.0.1, host port = 4443, guest ip = , guest port = 443
NIC 1 Rule(2): name = Web, protocol = tcp, host ip = 127.0.0.1, host port = 8800, guest ip = , guest port = 80
NIC 1 Rule(3): name = Web8080, protocol = tcp, host ip = 127.0.0.1, host port = 8080, guest ip = , guest port = 8080
...
The guest is accessible from the host over ssh with either of the following commands...
Code: Select all
host:~$ ssh -p 2224 localhost
host:~$ ssh -p 2224 127.0.0.1
Code: Select all
host:~$ links2 localhost:8800
host:~$ links2 127.0.0.1:8800
host:~$ links2 http://localhost:8800
host:~$ links2 http://127.0.0.1:8800
Code: Select all
guest:~$ sudo systemctl status apache2
[sudo] password for user:
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
...
Active: active (running) since Tue 2019-10-29 14:40:39 EDT; 2h 52min ago
...
Oct 29 14:40:39 cms-vm systemd[1]: Started LSB: Apache2 web server.
Code: Select all
guest:~$ links2 127.0.0.1
guest:~$ links2 http://127.0.0.1
guest:~$ links2 http://localhost
Code: Select all
guest:~$ links2 localhost
Code: Select all
guest:~$ sudo netstat -l
[sudo] password for user:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost.localdoma:953 *:* LISTEN
tcp 0 0 localhost.localdo:mysql *:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:domain [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 localhost:953 [::]:* LISTEN