0

I am using Ubuntu 14.04 With LAMP, SSH

I can connect fine using putty with 192.168.0.194. It works fine with my current router when I use localhost or the IP address. But once I go to another router or someone else tries to use it either doesn't connect or says that it can't connect.

I have port forwarded it, 192.168.0.194 with multiple ports, I've tried 20-80.

This is my ifconfig:

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

p5p1      Link encap:Ethernet  HWaddr 14:da:e9:36:89:c8
          inet addr:192.168.0.194  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::16da:e9ff:fe36:89c8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:219 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:52259 (52.2 KB)  TX bytes:7199 (7.1 KB)

Most tuts use eth0, I've tried, reinstalled 6 times now, always does p5p1.

Here is my netstat

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 localhost:mysql         *:*                     LISTEN
tcp        0      0 *:ssh                   *:*                     LISTEN
tcp        0     64 192.168.0.194:ssh       192.168.0.198:57415     ESTABLISHED
tcp6       0      0 [::]:http               [::]:*                  LISTEN
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     12224    /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     SEQPACKET  LISTENING     11362    /run/udev/control
unix  5      [ ]         DGRAM                    13937    /dev/log
unix  2      [ ACC ]     STREAM     LISTENING     8160     @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     12547    /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     9959     /var/run/acpid.socket
unix  2      [ ]         DGRAM                    9930
unix  3      [ ]         STREAM     CONNECTED     13924
unix  3      [ ]         STREAM     CONNECTED     11703
unix  3      [ ]         STREAM     CONNECTED     9747     @/com/ubuntu/upstart
unix  3      [ ]         STREAM     CONNECTED     15626
unix  2      [ ]         DGRAM                    14339
unix  3      [ ]         DGRAM                    8324
unix  3      [ ]         STREAM     CONNECTED     15630
unix  3      [ ]         STREAM     CONNECTED     9744
unix  3      [ ]         STREAM     CONNECTED     13923
unix  3      [ ]         STREAM     CONNECTED     13930    /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     12537
unix  3      [ ]         STREAM     CONNECTED     12557    /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     12691    /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     9839
unix  3      [ ]         STREAM     CONNECTED     13918    @/com/ubuntu/upstart
unix  3      [ ]         STREAM     CONNECTED     10336
unix  3      [ ]         STREAM     CONNECTED     15625
unix  3      [ ]         DGRAM                    8325
unix  2      [ ]         DGRAM                    11687
unix  3      [ ]         STREAM     CONNECTED     9397     @/com/ubuntu/upstart

Then my /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p5p1
iface p5p1 inet static
address 192.168.0.194
netmask 255.255.255.0
network 192.168.0.1
broadcast 192.168.0.255
gateway 192.168.0.1
dns nameservers 8.8.8.8.8.8.4.4
3
  • People can't connect to your server from a local IP. Give them your public IP.
    – Goddard
    Mar 28, 2016 at 21:57
  • Sorta new at this, how would i do that? Where is it located :) Thanks! Mar 28, 2016 at 22:20
  • To get your public IP: go to whatismyip.org - or from the terminal - dig +short myip.opendns.com @resolver1.opendns.com
    – user423626
    Mar 29, 2016 at 6:17

1 Answer 1

0

IPs like 192.168.x.y are part of the local network, so can only be used from within that network. If you are using other routers and their dhcp options are set the same it should give you the same internal IP and everyone on connected to that router should be able to connect to your laptop.

To find out your external IP, you can go to a site like whatismyip.com also please note that your external IP is given to you by your ISP and may change.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .