I'm just setting up a development server at home. I'm using Apache, and for starters I want to access its welcome page from internet.
My network diagram looks like this:
— An ONT router set as a bridge.
— The routing is done via a Mikrotik hAP ac². The web interface is accesible from internet via its public IP,193.248.32.7 —not the real one, of course—.
— Two clients with dynamic IPs
— One local server —with firewall disabled for testing purposes— and this IP settings:
Code: Select all
network:
ethernets:
eno1:
dhcp4: no
addresses: [192.168.88.246/24]
gateway4: 192.168.88.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
Code: Select all
$ ssh myuser@192.168.88.246
$ curl http:localhost:80
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
etc.
Now I want to do the same thing from outside my network, so I set up a NAT in the Router for any ethernet interface and port 4000, to 192.168.88.246 and port 80
Code: Select all
/ip firewall nat add chain=dstnat action=dst-nat protocol=tcp in-interface=all-ethernet dst-port=4000 to-addresses=192.168.88.246 to-ports=80 comment="NAT HTTP"
Code: Select all
\$ curl 193.248.32.7:4000
curl: (7) Failed to connect to 193.248.32.7 port 4000: Connection refused
Pointing to the router IP reaches the router itself, asking for password:
Code: Select all
\$ telnet 193.248.32.7
Connected to 193.248.32.7
Escape character is '^]'.
Password:
Code: Select all
\$ telnet 193.248.32.7 4000
Trying 193.248.32.7...
telnet: connect to address 193.248.32.7: Connection refused
telnet: Unable to connect to remote host