Welcome to the fourth part of our usenet series. This section doesn’t really tell you anything usenet specific, but we are going to discuss a few common features so that we can get the most out of our usenet applications.
Before we get started you’ll need to be able to access your home router’s configuration page. This can usually be done by typing “192.168.0.1” or “192.168.1.1” into your browser. Which IP address you’ll use depends on which model router you have. The best way to find out is to go to your router’s support page and read up about what the default IP address is and what the default username and password is.
What is Port Forwarding?
Port forwarding is a fancy way of saying we’re going to forward requests for web pages from your router to different computers in your house. I think the best way to explain how port forwarding works, is to give you an example you’ll use. For our purposes, we’re going to talk about how port forwarding plays a role in remotely accessing your SABnzbd application.
Your home internet connection has what’s called a WAN IP (Wide Area Network Internet Protocol). This is basically your internet address, just like the address on your house. Your router gets this WAN IP and then uses it’s own DHCP server (Dynamic Host Configuration Protocol) to dish out LAN IPs (Local Area Network Internet Protocol). I know all these terms sound confusing, but think of your router as a splitter, it turns one line into many. For example, you might have a WAN IP of 126.96.36.199 and your router would split that into a local IP address of 192.168.0.100, 192.168.0.101, 192.168.0.102, etc. In this scenario, your server might have the 192.168.0.100 address, your laptop might have 192.168.0.101 address, and your smart phone might have the 192.168.0.103 address.
If you’ve been following our usenet series, you should have a setup similar to the one shown in the picture below (Might not have SickBeard or CouchPotato setup yet, that’s fine).
If you notice in the picture above, someone on the internet is making a request for a webpage on our public IP address using port 8080. However, there is no application running on port 8080 of our router. Without forwarding the port, the page will not be found. Looking at the diagram above, SABnzbd is running on port 8080, but it’s hosted on our Media Server which is located at the local IP address of 192.168.0.100. In order to be able to access it from the internet, we need to forward port 8080 in the router to port 8080 on our Media Server at 192.168.0.100. After we set up the port forwarding, all requests to http://188.8.131.52:8080 will be forwarded to the internal address of http://192.168.0.100:8080.
How Do I Setup Port Forwarding In My Router?
It would be nice if I could give you a step my step screenshot and tell you how to forward ports on every brand of router, but unfortunately there are too many different model routers out there. Instead I’ll show you how I setup port forwarding on my Netgear router and hopefully you’ll be able to translate that over to your particular brand of router.
After logging into my router there is an option for “Port Forwarding” from the menu on the left. From there I select a button called “Add Custom Service“. The resulting screen looks like the image below.
Service Name: The service name will be the name of the application you’re forwarding the port for. In this scenario, that’s “SABnzbd“.
Service Type: This application only requires TCP, but some other applications might require UDP as well. If you’re unsure, just set to TCP and UDP.
External Starting / Ending Port: External ports are the ports used when the request comes from the internet, in our scenario that’s 8080. Many routers allow you to forward a single port like 8080 or a range of ports like 8080-8085. Because of that, this configuration has a starting and an ending external port field. Since we only want to forward one port, we’ll make our starting port 8080 and our ending port the same 8080.
Internal Starting / Ending Port: Internal ports are the ports used when the request is forwarded to the Media Server. In our case that’s going to be port 8080. However, we could forward external port 80 (which is the default port for web pages) to internal port 8080 on our Media Server. Since 80 is the default port for the HTTP protocol, we could simply type “http://184.108.40.206” into our browser and it would know to use port 80. That request would hit our router and then forward that request to the internal address of “http://192.168.0.100:8080“. For our purposes, we’re going to leave it forwarding external port 8080 to internal port 8080 on our Media Server.
Internal IP Address: This is the internal IP address for our Media Server, in our scenario, 192.168.0.100.
Remember that DHCP thing I mentioned earlier? The key part of that initialism is “Dynamic“. Your router dishes out local IP addresses dynamically, but what does that mean for you? Let’s again walk through a scenario. Suppose you’re all happy because your server is running on 192.168.0.100 and you’ve got 8080 forwarding to that local IP address. You can access SABnzbd remotely from any computer on the internet and life is good. But then the power at your house goes out and when everything comes back on, your Media Server gets assigned a different local IP address from your router. Now the local IP address is 192.168.0.105. Crap… now your ports aren’t forwarding to the right local IP address and you’ve lost remote access to SABnzbd.
We’re going to prevent the above situation from happening by using something called “DHCP Reservation“. DHCP Reservation is a utility found in most routers where you basically say, “Media Server is always going to be 192.168.0.100, don’t give that local IP to any other device on my network.” That way, when the power goes out and comes back on, your Media Server will pull the same local IP address of 192.168.0.100.
Just like port forwarding, I can’t tell you precisely how to do this because every router is different. Instead, I’m going to again show you what it looks like on my router.
The above picture is just an example. For our scenario, the IP address would read “192.168.0.100“. The MAC address is a unique address for your Media Server. My router has an option to allow me to select the mac address from a list. If you don’t have that option in your router, you may have to google how to find the MAC address for your Media Server. The device name is usually the host name of your Media Server. Again, mine let me select from a list, if you don’t have that option, google is your friend.
Dynamic WAN IPs and DynDNS
Everything listed above is all well and good if you know what your WAN IP address is. Your internet service provider uses a dynamic system to give you a WAN IP address so it’s going to change. Sure, today it’s 220.127.116.11 but tomorrow it might be 18.104.22.168. If that happens and you don’t know that it happened (which you likely wouldn’t) then you’re out of luck.
This is where the handy site NoIP.com or Dyn.com come in to play. These sites offer a service called “Dynamic DNS“. When you sign up for a free account on either site, you’ll get a hostname like “yourusername.no-ip.biz“. The goal is to make this hostname always point to whatever your dynamic WAN IP gets changed to. There are a couple of ways to update NoIP.com or Dyn.com whenever your WAN IP address changes. Each site has an application you can install on a computer in your home that will update NoIP.com or Dyn.com whenever the WAN IP changes. Even easier, if you have a router that allows dynamic DNS updating (yours probably does), simply add your NoIP.com or Dyn.com account details and it will update the site whenever your WAN IP changes. Just like all the other router settings, you’ll have to login and look for this option and configure it. They all ask the same basic info like, username, password, and hostname.
If you’ve set up your dynamic DNS hostname properly, you should be able to go to, “http://yourusername.no-ip.biz:8080” and it will display your SABnzbd Application. This might take a little bit to update the first time. Once it’s setup though, you’ll be able to access your SABnzbd application from anywhere in the world. And now that you can access your SABnzbd from anywhere in the world, we can make use of the API keys to directly send .nzb files from index sites to your SABnzbd application.
What is an API?
API stands for “Application Programming Interface“, we nerds love to make things sound complicated. APIs are like the computer version of that childhood game “Simon Says“. Only instead of trying to get your little brother to shave the cat so he won’t lose a game, you’re telling a computer to do things for you. Granted, not as exciting, but just as useful for entertainment purposes.
When a program has an API interface, that means it allows itself to be controlled by another program so long as that program uses the secret word, which in our case is the API key. When one computer tells another computer what to do without providing a valid API key, it’s like just saying “jump three times” in a game of Simon says, it just looks at you blankly. However, when the computer tells the other computer what to do with a valid API key, “Simon says go get that .nzb file“, the computer does it. SABnzbd has two API keys, one it refers to as just the “API Key” and another it refers to as the “NZB Key“. The API key can be used to tell SABnzbd to change just about any setting SABnzbd has. The NZB key can only be used to send .nzb files to SABnzbd for processing. To help you understand how they work, let’s look at two examples.
Example 1: Using the NZB Key to send .nzb files directly to your SABnzbd from the index site NZBFinder.ws. Rather than going to NZBFinder.ws, downloading the .nzb file to your computer, then going to your SABnzbd application and manually uploading the .nzb, we’re going to send it directly from NZBfinder.ws to your SABnzbd application. Once you’ve logged into NZBFinder.ws, click on your username at the top right and select “profile“. Once you’re on the profile section, click the “edit” button at the top. Scroll down until you get to the section I show below.
This page asks for your SABnzbd public url. Now that you have one of those, enter it here. Now you’re going to head over to your SABnzbd website and make your way to the “General” section of the config screens. There you’ll find the NZB Key for your SABnzbd application. This is the secret password NZBFinder.ws will use to send .nzb files directly to your SABnzbd application. Copy the NZB key and head back to the NZBFinder.ws profile page and enter the key in the specified field. Select the radio button for NZB key, set the priority to “normal” and then select the radio button for “site” so that you can use this feature on any computer you happen to visit this site on. Once you have all the information entered, click the “Save Profile” button at the bottom.
Example 2: Using the API key to control your SABnzbd application from your smart phone. If you have a smartphone there are a number of applications available to control SABnzbd. Since these applications will need to perform other functions besides sending .nzb files, you’ll need to give it the full API key so that it can do things like, pause the server, change the priority or category of a download, or even restart SABnzbd. I won’t go into detail with how to configure one of these applications other than to tell you you’ll find your SABnzbd’s full API key in the same place we found the NZB key above. The application will ask you for mostly the same information, the public url, your API key, and probably your username and password as well.
Well let’s see, if you’ve been following us from the start, you know what usenet is. You have access to your local usenet server. You also have a media server that’s always on and running SABnzbd. You’ve also configured your router to be able to remotely access SABnzbd, manage that SABnzbd application from anywhere, and you have the ability to use APIs to send .nzb files to it directly. You’re well on your way to a complete usenet media center setup.
In the next article, we’re going to learn another main player in our automated usenet setup, SickBeard. We’re going to talk about what it’s function is and how to configure it.