Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Ubuntu Server works on Lan but not outside

  1. #1
    Join Date
    Apr 2012
    Beans
    68
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question Ubuntu Server works on Lan but not outside

    My Ubuntu server can be accessed on the LAN, but not the WAN. I have been able to gain access to the server with sftp and ssh, but again only if the said machine trying to get access is on the LAN. While attempting to view the webpage or ssh into the server from outside the LAN it times out every time. I have set up port forwarding. Not sure as to what I could be missing. Is there something on the actual server that I need to setup or manage?
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Ubuntu Server works on Lan but not outside

    Hi saponempotenti.

    Before troubleshooting I just want to make sure that you actually are trying to access your server from outside your network, and not from inside but using public IP. Most routers won't allow that. If you are using your phone or tablet 3G service, make sure they are disconnected from your WiFi.

    Regards.

  3. #3
    Join Date
    Aug 2008
    Beans
    1,835
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ubuntu Server works on Lan but not outside

    First make sure the server has a default route specified that points at the WAN router. What do you get from

    Code:
    ip route list

    As papibe said you may also need to set up port forwarding on your router for outside things to connect in.

  4. #4
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Ubuntu Server works on Lan but not outside

    another thing to check is that you don't have a firewall rule on the server that is restricting ALLOW addresses to your LAN IP range

  5. #5
    Join Date
    Apr 2012
    Beans
    68
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ubuntu Server works on Lan but not outside

    Quote Originally Posted by papibe View Post
    Hi saponempotenti.

    Before troubleshooting I just want to make sure that you actually are trying to access your server from outside your network, and not from inside but using public IP. Most routers won't allow that. If you are using your phone or tablet 3G service, make sure they are disconnected from your WiFi.

    Regards.
    I have tried from several machines outside the network as well as my phone with 4g

  6. #6
    Join Date
    Apr 2012
    Beans
    68
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ubuntu Server works on Lan but not outside

    Quote Originally Posted by alphacrucis2 View Post
    First make sure the server has a default route specified that points at the WAN router. What do you get from

    Code:
    ip route list

    As papibe said you may also need to set up port forwarding on your router for outside things to connect in.
    paulson@ProQuaerendumScientiam:~$ ip route list
    default via 192.168.1.1 dev eth1 metric 100
    192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.111

    As I am fairly new to linux I am not sure how to interpret that :/

  7. #7
    Join Date
    Apr 2012
    Beans
    68
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ubuntu Server works on Lan but not outside

    Quote Originally Posted by steeldriver View Post
    another thing to check is that you don't have a firewall rule on the server that is restricting ALLOW addresses to your LAN IP range
    While attempting to fix the issue I thought of that and completely removed shorewall, but still no luck.

  8. #8
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Ubuntu Server works on Lan but not outside

    I'm not a routing expert but that looks OK to me (mine is analogous - assuming 192.168.1.1 is your router/gateway and 192.168.1.111 is the machine's LAN IP)

    It still may be worth a quick check on firewall status - since other tools can mess with iptables let's look right down at that level if possible e.g.

    Code:
    $ sudo iptables -L | grep -E 'dpt:((ssh)|(http))'
    
    $ sudo ufw status numbered

  9. #9
    Join Date
    Apr 2012
    Beans
    Hidden!

    Re: Ubuntu Server works on Lan but not outside

    Hi, ssh is a little confuseing when you are new to it.
    let's see if we can remove some of the mystery.

    to ssh inside the lan...you enter -> ssh -p (port#) user@ip address
    ssh -p 22 aname@192.168.1.8 <-example

    to ssh from OUTSIDE you enter -> ssh -p (port#) user@ROUTER ip
    ssh -p 22 aname@75.100.22.39 <-example

    *To find Your ROUTER IP ..from a browser connection enter -> canyouseeme.org
    this will display YOUR ROUTER IP

    * BEFORE you can connect from outside the lan you MUST portforward your port (22) example to your lan ip.

    *example..in router port forwarding settings. -> start 22 end 22 ip 192.168.1.8
    *read your router manual on HOW TO PORT FORWARD..
    *note ssh to router ip from INSIDE the lan does NOT work.
    hope this helps.

    *edit: didnt see your attachment till after i posted. oh well..
    Last edited by Hadaka; April 17th, 2013 at 10:10 PM.
    Craving anchovy, herring and squid pizza.....with clam sauce

  10. #10
    Join Date
    Apr 2012
    Beans
    68
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ubuntu Server works on Lan but not outside

    After reading all the advice (steel driver, your commands just caused the terminal to hang so was slightly confused about that) I am pretty sure the cause of the problem is my router blocking all incoming requests. Would that make sense with the situation?

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •