Jump to content
Phishing Emails & YouTube Messages - Fake Giveaway Read more... ×
Search In
  • More options...
Find results that contain...
Find results in...
LiamOlsson

Networking on linux?

Recommended Posts

Posted · Original PosterOP

I have a ubuntu desktop connected to a router(not a modem with a UI or whatever) this is at school so what i want to do is open the port 80 so that i can "publish" my website. I know i have to open the port / allow the port in firewall which i have but the problem is more portforwarding i dont know how to open the port for the public so that they can access the website. Is there anyway i can make a virtual machine with linux and make it a router so that i can portforward through that "router"?

Link to post
Share on other sites

There's almost zero chance your school are going to allow you to forward any ports on their network but especially not port 80.

 

Also no, you cannot bypass the schools firewall and I may be wrong but I'm pretty sure asking that here is against the forum CoC.


Main Rig:-

Ryzen 7 2700X @ 4.2Ghz | Asus ROG Strix X370-F Gaming | 16GB Team Group Dark T-Force 3200Mhz | Samsung 970 Evo 500GB NVMe | Asus Rog Strix Vega 64 8GB OC Edition | Coolermaster Master Air 620P | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Coolermaster Master Box MB520P | Acer XB280HK 4K G Sync | Windows 10 Pro X64 |

Link to post
Share on other sites
Posted · Original PosterOP

@RandomGuy13 because it's at school we use our own server i dont have "access" to the server because we don't really have a "IT guy" so that's why im wondering if there are other ways to portforward

P.S i know simple portforwarding with routers 

Link to post
Share on other sites
Just now, LiamOlsson said:

@Master Disaster i can promise you that wont be a problem

 

I can promise you it will. The port needs forwarding on the schools main router so unless you have administrator access to that you cannot do it.


Main Rig:-

Ryzen 7 2700X @ 4.2Ghz | Asus ROG Strix X370-F Gaming | 16GB Team Group Dark T-Force 3200Mhz | Samsung 970 Evo 500GB NVMe | Asus Rog Strix Vega 64 8GB OC Edition | Coolermaster Master Air 620P | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Coolermaster Master Box MB520P | Acer XB280HK 4K G Sync | Windows 10 Pro X64 |

Link to post
Share on other sites
2 minutes ago, LiamOlsson said:

@RandomGuy13 because it's at school we use our own server i dont have "access" to the server because we don't really have a "IT guy" so that's why im wondering if there are other ways to portforward

P.S i know simple portforwarding with routers 

Port forwarding happens on the part of your network where the internet enters the building and is routed. It's in the school's firewall. I can nearly guarantee you that they are not gonna let you just go pokin' around their firewall to port-forward port 80. Or any port for that matter. Do it at home or get your own ISP.


"Although there's a problem on the horizon; there's no horizon." - K-2SO

Link to post
Share on other sites
Just now, LiamOlsson said:

It's more about how im supposed to do it

 

Ok so im guessing you want this website to be on the internet, publically visible right? So you would need acess to the router to port forward. If you just want it to be accessable on the scool network then its possible other ways.

Link to post
Share on other sites
2 minutes ago, Master Disaster said:

I can promise you it will. The port needs forwarding on the schools main router so unless you have administrator access to that you cannot do it.

Im assuming hes not a student

Link to post
Share on other sites
3 hours ago, LiamOlsson said:

It's more about how im supposed to do it

 

You need access to your school's router, you can't emulate it for the simple reason that your traffic still needs to go through the real one. Once you have that, there should be a section called "port forwarding" or something similar; from there, you can set the internal address (your pc's ip address and port, in your case 80) and the corresponding external port, which can be 80 or whatever else you prefer.

 

Since your router is separate from the modem, you also need to do the same in the modem, but for the modem you'll have to use the router's ip address relative to the modem itself.


<Make me a sandwich.> <No! Make it yourself!> <Sudo make me a sandwich.> <FINE.> What is scaling and how does it work? Asus PB287Q unboxing! Console alternatives :D  CoC F.A.Q Beginner's Guide To LTT (by iamdarkyoshi)

Sauron'stm Product Scores:

Spoiler

Just a list of my personal scores for some products, in no particular order, with brief comments. I just got the idea to do them so they aren't many for now :)

Don't take these as complete reviews or final truths - they are just my personal impressions on products I may or may not have used, summed up in a couple of sentences and a rough score. All scores take into account the unit's price and time of release, heavily so, therefore don't expect absolute performance to be reflected here.

 

-Lenovo Thinkpad X220 - [8/10]

Spoiler

A durable and reliable machine that is relatively lightweight, has all the hardware it needs to never feel sluggish and has a great IPS matte screen. Downsides are mostly due to its age, most notably the screen resolution of 1366x768 and usb 2.0 ports.

 

-Apple Macbook (2015) - [Garbage -/10]

Spoiler

From my perspective, this product has no redeeming factors given its price and the competition. It is underpowered, overpriced, impractical due to its single port and is made redundant even by Apple's own iPad pro line.

 

-OnePlus X - [7/10]

Spoiler

A good phone for the price. It does everything I (and most people) need without being sluggish and has no particularly bad flaws. The lack of recent software updates and relatively barebones feature kit (most notably the lack of 5GHz wifi, biometric sensors and backlight for the capacitive buttons) prevent it from being exceptional.

 

-Microsoft Surface Book 2 - [Garbage - -/10]

Spoiler

Overpriced and rushed, offers nothing notable compared to the competition, doesn't come with an adequate charger despite the premium price. Worse than the Macbook for not even offering the small plus sides of having macOS. Buy a Razer Blade if you want high performance in a (relatively) light package.

 

-Intel Core i7 2600/k - [9/10]

Spoiler

Quite possibly Intel's best product launch ever. It had all the bleeding edge features of the time, it came with a very significant performance improvement over its predecessor and it had a soldered heatspreader, allowing for efficient cooling and great overclocking. Even the "locked" version could be overclocked through the multiplier within (quite reasonable) limits.

 

-Apple iPad Pro - [5/10]

Spoiler

A pretty good product, sunk by its price (plus the extra cost of the physical keyboard and the pencil). Buy it if you don't mind the Apple tax and are looking for a very light office machine with an excellent digitizer. Particularly good for rich students. Bad for cheap tinkerers like myself.

 

 

Link to post
Share on other sites

This is more a networking question than a linux question.

 

First, lets do a mini network map to understand what you're doing

 

INTERNET -> ROUTER -> COMPUTER (web server)

 

You want people from the internet, to be able to see a webpage running on your computer.

 

I assume you know how to build a webserver and that you have one running succesfuly on port 80 of your computer. if not. than stop this thread  now as you're not even ready for the networking portion.

 

So the next step once above is working is to tell the router that you need connections that come in from the internet, on port 80, to go to your computer on the network.

 

this depends on what software the router is running. Now this might be where the confusion lies, but typical high grade routers aren't just running your run of the mill linux. So it gets things even more confusing and difficult.

 

the rest of this assumes that you are logged into the linux shell on the router.

 

if it is linux however, then you're going to have to modify the iptables to instruct the networking to forward those ports. iptables can be quite a confusing thing as it has multiple uses, purposes and ways of reading it, and screwing up a rule here could bring down the entire internet for your school.

 

the command would look similar to this, but again, if you just copy and paste this yo'll likely just break your network. you need to UNDERSTAND WHAT IPTABLES ARE BEFORE MESSING WITH THEM! I highly recommend doing a massive read on iptables before proceeding

 

the command would look similar to this

iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 80  NEW -j ACCEPT

 

what this basically means:

iptables = the linux exec

"-A" add rule

"FORWARD" is the rule type

"-i eth0" input interface. this is your WAN interface, that has connection to the internet

"-o eth1" output interface, this is your LAN interface that connects to the internal network your computer resides on

"-p tcp" which protocol to forward. this case is TCP

"--dport 80" this is the port to forward

"-j ACCEPT" default ruleset is to accept connection on this port. 

 

I maybe missing a specific flag in this command... it's been a long time since i screwed around with port forwarding directly in linux and worrying about setting my own IPTables. Typically, most modern routers have a nicer web UI to do this on.

 

and of course, as previously mentioned yet again, if the router isn't actually running linux, than the above will just break everything, if it even lets you run it.

 

 


Quote

"Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so." - Douglas Adams

System: R7-1700, MSI B450i PLUS AC, Nvidia Geforce 1070. 16GB DDR4.

Link to post
Share on other sites

If your school has public addresses, and no NAT's (not very probable) and it is not protected, the port 80 can be accessed from remote 

You can access it from the inside in any case, but not from the outside in case of NAT unless you got access to the school router which is connected to the Internet 
Do you have the permissions to do that? Why they would let you mess with their routers if you don't know those things? 

In Linux server distros without any software firewall installed, you can just set up a server and it will be connected to the outside so no setup required in there
 

Edited by Lukyp

My guides: Linux PCI GPU VFIO Passthrough,  Running X11 GUI WSL apps on Windows w/audio NO SSHBest gaming setup on Linux desktop and LaptopsSet up a OpenVPN Server on Windows,

[GUIDE] Solving most common Linux issues - FAQ, general troubleshooting megathread reference, noob friendly

Laptops: - Thinkpad x60S, CPU: Core Duo, RAM: 4GB, GPU: Intel, 945M. Only Freebsd and Linux on it  - Dell XPS 15 9550, i5 6300HQ, 8GB DDR4, Crucial MX500 512GB, GTX 960M, Windows 10 and Kubuntu
Desktop: CPU: AMD Ryzen 5 1600, RAM: HyperX 2667 OC 4x4GB, GPU: Zotac 1060 3GB Mini, SSD: Crucial MX500 512GB, PSU: Enermax Triathlor ECO 550W, MOBO: MSI B350M Mortar, Windows 10 modded to act normally, and Kubuntu
Headphones: AKG K240 Studio + Edifier h180 Mice: Zowie FK2 ScreenBenQ XL2411 144Hz MousepadHP Omen 300 XL KeyboardCM Storm Ultimate Cherry MX Brown

My last.fm: http://www.last.fm/user/luky_

Server: Acer Aspire M1610, CPU: Intel Pentium D, RAM: 4GB, GPU: SiS IGPU, 60GB SSD + 160GB HDD, OS: FreeBSD, Manjaro Linux, Windows Server 2016

Link to post
Share on other sites
On 1/22/2019 at 1:31 PM, LiamOlsson said:

that's why im wondering if there are other ways to portforward 

The only way to set the router up for port forwarding is to have access to the router. Since you seem to be trying really hard not to ask how to subvert not having access to the router the only *real* advice I can give is don't use port 80. Search around for an open port and use that.

There's no technical reason why you can't use another port on a webserver other than that it's commonly accepted that HTTP will be on port 80, and so when you type a URI into the search bar, you don't have to type HTTP://<myURI>.<myDomain>:<myPort>.

For example, this website is actually https://linustechtips.com:80. But that's pretty ugly, so your browser does two things: Assume that you're using HTTP, so you don't have to type that, and then assumes that because you're using HTTP, you're using port 80, so you don't have to type that.

But there's no reason why you can't run it on some other port that your network admins may have left open, except for now everyone who wants to visit your site will have to manually type the port number.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Buy VPN

×