1

Should connecting to my.public.real.ip/24 from another device on a different network connect me to my PIs hosted web page if I have installed apache+gave it static ip+port-forwarded? Is using DNS mandatory? If not what am I missing?


I have been trying to set up my Raspberry Pi as a simple server for about a day now. I followed this tutorial.

My understanding of how servers work is very limited. I get to the step where I set up my static IP (but take it from another tutorial) which seems to be working since every time it boots it picks 192.168.0.111/24 (which is what I picked). And I think I do the portforwading correct.

While I am fairly certain it is a static IP by default by my ISP is it an issue if it isn't? I will be the only one using it since I will use it for home automation. For the last month it has not changed and issues like it changing from week to week won't affect me that much.

ifconfig output

eth0      Link encap:Ethernet  HWaddr b8:27:eb:bc:37:7e  
      inet6 addr: fe80::bda7:f79d:d4e1:54c5/64 Scope:Link
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:404 errors:0 dropped:0 overruns:0 frame:0
      TX packets:404 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1 
      RX bytes:37749 (36.8 KiB)  TX bytes:37749 (36.8 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:e9:62:2b  
      inet addr:192.168.0.111  Bcast:192.168.0.255  Mask:255.255.255.0
      inet6 addr: fe80::d690:abfc:41c2:7d96/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:10086 errors:0 dropped:0 overruns:0 frame:0
      TX packets:6520 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:9450949 (9.0 MiB)  TX bytes:880856 (860.2 KiB)

the end of dhcpcd.conf:

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

interface wlan0
       static ip_address=192.168.0.111/24
       static routers=192.168.0.1
       static domain_name_servers=192.168.0.1

Note: I get the same result if I use port 80 but I am trying to avoid it because I am not sure if the ISP blocks it.

I have TP-LINK TL-WDR3600

For some reason I have issues uploading pictures from the raspberry so here is how I forwarded it:

connected to 192.168.0.1

There is some GUI and a menu 'Forwarding'

It has under menus as

  • Virtual servers
  • Port Triggering
  • DMZ
  • UPnP

It seems Virtual servers is the option I need since it is the only one that allows me to set the IP address of the PC running the service application.

Virtual service has the following inputs:

Service Port:24
Internal Port:24
IP Address: 192.168.0.111
Protocol: All (options are TCP and UDP)
Status:Enabled
  • Judging from what you wrote, you cleanly has several misunderstanding on how IP/network works. 1) You probably don't understand the meaning of /24, it is not refer to port, it defined your network subnet. Read this. 2) your public IP seldom change doesn't mean you have a fixed IP, unless you paid a premium for fixed IP and for commercial (vs residential) subscription. 3) Your ISP won't block port 80 as it is the default and most common internet access port, if your ISP block port 80, your browser/router won't work without specific configuration. – hcheung Sep 6 '17 at 14:33
0

For some reason just when I wrote the question I found there is one more step: Change the apache listening port too.

This is what I did:

https://stackoverflow.com/questions/3940909/configure-apache-to-listen-on-port-other-than-80

I am not sure why it was not working on port 80. Maybe my ISP is actually blocking it.

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.