LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-23-2016, 11:16 AM   #1
JamesAghaji
LQ Newbie
 
Registered: Jun 2016
Posts: 6

Rep: Reputation: Disabled
Enable incoming connections from outside your home network, without a router


hello all, I have a simple question. I dont have a router. i connect to the internet through a usb dongle (wwan0) or through hotspot from my android phone. i want to be able to view my web server outside my local network... i have apache server running on my local network in germany and i want my friend in france to be able to view it if i give him my external (public) ip address. how do i configure the NAT Gateway, Iptables, Port Forwarding, DNS And DHCP Setup, etc to be able to achieve that? my operating system is kali linux rolling edition (2016). if its not possible (which i doubt), is there a software i can use to be able to achieve that? My goal is to allow someone outside my home network to view my webpage on port 80. thanks
 
Old 06-23-2016, 11:36 AM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You run web server on Kali? I was thinking I've seen it all ...
 
Old 06-23-2016, 11:41 AM   #3
JamesAghaji
LQ Newbie
 
Registered: Jun 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
You run web server on Kali? I was thinking I've seen it all ...
Alright, technically, I want to be able to do a metasploit reverse_tcp over the internet. I dont know what to set as my LHOST. Thats the beginning of my challenge.
 
Old 06-23-2016, 11:58 AM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You need to provide a lot more detail on your network setup.

A USB dongle that connects to what? And if you're connecting through a hotspot generated by your mobile phone, then your mobile phone IS the router. If your mobile phone doesn't provide a way to set up port forwarding to devices connected to its hotspot, then you're out of luck, but even if it could you're probably still out of luck because the IP your phone has on the mobile network is most likely a private IP on a NAT generated by your service provider and is not publicly routable anyway.
 
Old 06-23-2016, 02:42 PM   #5
JamesAghaji
LQ Newbie
 
Registered: Jun 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
You need to provide a lot more detail on your network setup.

A USB dongle that connects to what? And if you're connecting through a hotspot generated by your mobile phone, then your mobile phone IS the router. If your mobile phone doesn't provide a way to set up port forwarding to devices connected to its hotspot, then you're out of luck, but even if it could you're probably still out of luck because the IP your phone has on the mobile network is most likely a private IP on a NAT generated by your service provider and is not publicly routable anyway.
The usb dongle connects to a 4g network, i use a prepaid sim card (just a normal internet surfer). my mobile phone is a samsung running on android marshmallow. If my IP is a private IP on a NAT generated by my service provider, is there any other way around it? What I want to achieve is running metasploit reverse_tcp over the internet and my LHOST (local host) is required. I've been using my internal IP for that, withing my internal network.
 
Old 06-23-2016, 02:48 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Well first you need to find out if your mobile broadband provider gives you a public or private IP. In my experience the majority are private, but you should be able to find the address assigned to your machine (usb dongle or android phone) and compare that to what you get if you go to www.whatismyip.com. If it is private, you'll need to call the provider to see if they have an option for purchasing a public IP instead, some do but you might need a business account for it.

If you just need to connect from a single machine, rather than from anywhere, then you can open a reverse ssh tunnel to that machine connecting your local port 80 to some port on that machine. At which point you can open a browser on the other machine machine, point it to localhost : port, and it will connect to your machine's http server through the ssh tunnel.
 
Old 06-23-2016, 03:13 PM   #7
JamesAghaji
LQ Newbie
 
Registered: Jun 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Well first you need to find out if your mobile broadband provider gives you a public or private IP. In my experience the majority are private, but you should be able to find the address assigned to your machine (usb dongle or android phone) and compare that to what you get if you go to www.whatismyip.com. If it is private, you'll need to call the provider to see if they have an option for purchasing a public IP instead, some do but you might need a business account for it.

If you just need to connect from a single machine, rather than from anywhere, then you can open a reverse ssh tunnel to that machine connecting your local port 80 to some port on that machine. At which point you can open a browser on the other machine machine, point it to localhost : port, and it will connect to your machine's http server through the ssh tunnel.
thanks @suicidaleggroll its a private IP. I'll go with the ssh option. Later on, when I have the money, I'll contact my ISP and do the necessary things.

I'll mark this thread as solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the service on a computer that allows incoming network connections? penquin.toes General 6 05-18-2016 06:40 AM
Ubuntu Server Does Not Accept Incoming Network Connections Like SSH Subject16 Linux - Networking 3 02-25-2011 03:37 PM
Home network for 6 Linux terminals and no broadband connections yulester Linux - Networking 4 04-02-2008 08:08 PM
linux home router reboot itself when NAT'ing for large number of connections asimov Linux - Networking 8 03-01-2008 09:22 AM
Home network setup with network firewall/router Gates1026 Linux - Networking 4 01-17-2005 08:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration