Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a server running with a dhcp public IP and ddclient updating my hostname from my public IP whenever it changes. My ISP has a feature for dyndns, so my router should automatically map my public ip to my hostname.

However, it only works within the LAN which tells me that the firewall is wrong.

I have forwarded ports 80 and 25565 (Minecraft server port) in my router config through 192.168.0.8 which is my static LAN ip for the server. But I am not sure if my iptables configuration is correct, here are the outputs of:

iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             udp dpt:25565
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:25565
ACCEPT     udp  --  anywhere             anywhere             udp dpt:10000
ACCEPT     udp  --  anywhere             anywhere             udp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            


iptables -t nat -L

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  anywhere             anywhere            


ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0e:7f:a9:10:54  
          inet addr:192.168.0.8  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20e:7fff:fea9:1054/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:847 errors:0 dropped:0 overruns:0 frame:0
          TX packets:797 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:106717 (106.7 KB)  TX bytes:282178 (282.1 KB)
          Interrupt:20 

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:76 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:6322 (6.3 KB)  TX bytes:6322 (6.3 KB)

My external IP is 2.126.189.150

And my hostname is helloworld.dyndns.org for reference

My router IP is 192.168.0.1

I have no outfacing interface configured (no eth1) because I have network manager installed

share|improve this question
1  
If your server works on the LAN, then odds are that it's your router that isn't forwarding things correctly. –  ImaginaryRobots Mar 8 at 16:37
    
Most routers support dynamic DNS services like dyndns.org which is where you really should set up that service. –  douggro Mar 8 at 18:35
    
I have set it up. My DynDns service is healthy, it's just that I need help with the FORWARDING and NAT rules on iptables. –  user240010 Mar 8 at 18:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.