Você está na página 1de 15

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

main 205 page stealth get a static IP nat recipes p2p port probe troubleshooting tricks advanced non-205 feedback [site notice] If you give a shit, BUY A SHIRT!

Static IP Address.
how to get one..
This page describes how to assign a "Static IP" to your local computer. If you are looking to get an external static IP, that is; a static IP for your whole internet connexion; see the notes at the foot of the article for more details, and also this post.

What is an IP address?
An IP address is like a telephone number that any computer can use to find any other computer in a network. All networked computers have IP addresses. Most have a static ip, that is, they don't change (for instance, at the time of writing, Google is 64.233.183.147 , and typing http://64.233.183.147/ into your browser will take you straight to Google. That is Google's "public IP", aka. "external IP" (one of them), behind their NAT are probably thousands of separate machines, each with different "private" IP's (probably static, or more likely a mix of dynamic and static IP's), 192.168.1.1, 192.168.1.2, etc., we don't see those. But some IP's do change.. Home computers, by default, are set to get their private IP address dynamically from your gateway device (router), via dhcp, In other words, the router supplies a private IP address for your computer to use, temporarily. However, this is not an ideal setup; if there is any interruption in the computer's network connexion to the router (you reboot, for instance), a completely new IP address may be assigned1. For general (beginner's) use, dhcp is just fine, because it's easier; generally requiring no configuration at all. But if you want to do more; run servers, p2p applications, interesting communication devices, etc, you'll be creating port forwarding/NAT rules on your router, to direct incoming traffic to a particular computer (the one running the server), and if you want those rules to be effective past a reboot, you will need to get a static IP so that the incoming data packets can still find you. Imagine the fun your friends and family would have contacting you if your telephone number changed every day!

1 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

okay, let's do it!


Now that you understand why you need to get a static IP, (apart from the obvious "cuz I want to forward my ports!") it's time to move on to the how part. "Private" IP addresses usually begin with 192.168** and must be on the same "subnet" that the router is on, in other words, 192.168.1.something, and NOT 192.168.4.something. Only the last number will be different from the address of your router which by default (at least for Voyager routers), lives at 192.168.1.1 . 192.168.0.1 is also common.
** There are other private ranges, too, but most people don't need to know about those, 192.168.1. something is what most folk use, and though thousands of millions of machines in the world have 192.168.1.something as their private IP address, they don't interfere with each other because they are behind NATs and other gateways; from the outside, we only see the public IP address, aka. "external IP".

The USB port on the router has probably already grabbed 192.168.1.2, so that leaves you with any number between 192.168.1.3 and 192.168.1.255 to use for your private computers, one unique number per machine. Remember to disable dhcp in your router before you start assigning static IP's.

Alternatively, create a new dhcp range somewhere away from your regular static IP's, handy for guests and what-not, perhaps 192.168.1.50 192.168.1.99

Fortunately, assigning a static IP is very easy to achieve, and the same principle applies to every computing platform, the only real difference being where to apply the settings. I'll start with the trickiest..

Windows..
The dialog you are looking for is here..
Control Panel >> Network Connections >> Local Area Connection >> Properties >> TCP/IP >> Properties

*phew* In other words, open the control panel, open Network Connections, right-click the "Local Area Connection" (unless you've renamed it to something else) and chose "Properties", then (in the "general" tab) select "Internet

2 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

Protocol(TCP/IP)" and click the "Properties" button. Check the "Use the Following IP address" checkbox and enter your desired IP address. If you use 192.168.1.3 as your IP address, the dialog will look something like this..

..which is a clever screencap, showing you just how to get there. When you're done, okay everything to close all the dialogs. It's smart to use 192.168.1.3 as your address, especially if you plan to use any of the ready-made script kicking around here. I you are plugging your computers into a network switch (Good Idea!), it's also smart to plug each machine into its corresponding CAT-5 socket, router (192.168.1.1) into the first, 192.168.1.3 into the third, and so on, so you can see which is which at-a-glance.

Mac OS X..

3 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

What you need is in the "Network" dialog of the System Preferences, and will look something like this..

Simply click the drop-down menu for "Show", and choose "Built-in Ethernet" to get that screen, enter all the details as above. Click "Apply Now", and you're done! Did you notice that on the Mac, you enter the Router's address into a space labelled as "Router", whereas, on Windows, you enter it into a space labelled "Default Gateway"? But then, the space for DNS servers is clearer in the Windows box. Seems we all still have a lot to learn from each other.

Linux..
This probably isn't necessary, most Linux users know how to alter this stuff, but I suspect one or two may not. Usually you need to edit some plain text file (as root). On some Linux systems, the settings will be in /etc/rc.d/rc.inet1 (or whatever interface you are using), or possibly /etc/network/interfaces . I

4 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

guess it might look something like this..

Usually, your distro will have a utility for setting up your network, and one of the first things it will ask you, after you tell it you want "manual" and not "automatic" configuration, is what IP address to assign to the machine. It's usually called something like "Network Configuration", or "inet configurator" or whatever. you'll find it! In a shell you can probably do "netconfig", "netcfg", "Ifconfig", "neat", or "netset" (depending on your distro). Same story for Unix, Solaris, BSD, etc..

That's it!
From now on, your machine will always be reachable at your chosen address. NAT rules will be permanent, and you can dabble in all sorts of interesting and esoteric communications devices, servers and p2p applications. If you have a few computers on your private network (LAN), you might want to consider giving them all names to go with their permanent addresses, so you can reach them by typing "workshop" or something into a telnet session/web browser/whatever. You could telnet to your router by simply doing telnet router, for instance. If you develop web sites, this is near essential. See here for more details. If you like, you can leave feedback (I thought it was about time this page had comments of its own - folk are coming straight here from the search engines, and it's getting popular!). If this page didn't help you, tell me about it! Have fun! ;o) (or

notes..
If you were actually wondering how to get a static IP for your whole internet connexion; aka. external IP; perhaps to run some live website or interesting server from your home or office, well, that's not something we mere mortals can do from our side of the router. You will need to talk to your ISP. Note: Not all ISP's offer this service, and those that do will usually charge a premium. However..

Most people do not need this!


Even those that think they do, or have been told they do. Perhaps you simply need to get yourself a dyndns.org or no-ip.com address, and a

5 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

DUC. Note: you can always get your current external IP address, in plain text, right here. Very handy for automatic shell scripts, and more. Right now, it's 219.93.178.162 .

references:
1. This is very similar to the way you get a new external IP whenever you dial-up to the internet (yup, some folks still do that) or disconnect your ADSL for a few minutes 2 (less scrupulous net citizens use this "feature" regularly!). 2. Although it's usual to get a new external IP when you reconnect your DSL, it's not guaranteed. With some ISP's it happens rarely, with others you need to disconnect for a few minutes or more, with some ISP's, you always get a fresh IP with each connect, nomatter how quickly you do it. One thing is certain, though; unless you are paying them for a static IP, your current external IP address will change! 3. Remember, your external IP, and your local computer's IP, are two totally separate things (well, in this context). Almost no one needs a static IP for their external connexion, but almost everyone who wants to run peer-to-peer applications, ftp servers, and so on, will need a static IP for their local computer. The former is supplied by your ISP, the latter is down to you.

Useful Links..
Your current external IP "Last IP" addon for IPCop Port probe Angry IP scanner Your current external ip address, in plain text. Always avaliable. Handy for scripting. What was your external IP before you reconnected your DSL? Handy. My handy port probe - instantly check if your server or p2p app is receiving connexions. Highly useful free IP scanner - handy for finding lost puters and routers on your LAN.

cbparser powered comments..

previous comments (two pages) show all comments


cor - 28.02.08 11:23 am butch, what you need to know is in the notes under the article. ;o) (or

Laura - 15.03.08 4:36 am I actully have a question instead of a comment,could someone

6 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

please tell me how to find someone's IP address that is hacking into your computer and saying & doing really bad things to your myspace?? please someone help? thank you. pretty please:(

cor - 15.03.08 5:24 am Laura, that's two questions. To find out the IP of someone cracking into your computer, start with your firewall logs, and if they are no help, run something like CurrPorts, and you'll see exactly who is connected, to what, and from where. It is very unlikely that someone is, unless you have a really duff setup, or Windows 98. As for myspace, I've really no idea how it works, or even what it is, exactly, but I assume you have some sort of login, and you've changed your password since this began, performed basic security measures like that. As to how they are actually "hacking" (sigh) it, try this useful link.. http://www.google.com/search?q=hacking+myspace ;o) (or

Laura - 15.03.08 6:15 am THANK YOU VERY MUCH WHOEVER YOU WERE,,CYA

siobian - 16.03.08 11:06 am Thank you so much for all that free info, you have restored my faith in humanity and my network sys. Very much appreciated.

sb - 25.03.08 7:46 pm I too have a question. I set my static internal IP address to 192.168.1.2. Then I created a dynamic DNS site, sax x.no-ip.org. When I connect to x.no-ip.org, I get the (correct) external IP address of my _router_. How can I "subselect" and connect to the static address of my computer (using WinSock for example), from any computer (not just ones in LAN)? Scheme: Router Address -> Local (STATIC) IP address

7 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

Is this possible? Many thanks. ps: I can set my DUC to local IP address too - but that only works in LAN.

cor - 26.03.08 1:04 am sb, WHAT? If you mean you want to run a server on the machine at 192.168.1.2, and you want to know how to forward the requests from the outside (WAN), through your router, to the machine in your LAN; then you need to do something called "Port Forwarding". Most routers can do this. You didn't say what model of router you have, so all I can suggest is you hunt around its firewall prefs. If you also want to access the server from inside your LAN using the no-ip.com address, you simply hack the address into your local hosts files (or caching DNS server if you run one). See here and here for more details. If you meant something else, get back with more/better info. Note: the secret to solving network troubles (and asking good networking questions) is to "think like a data packet", that is, follow its path from client to server. ;o) (or

QQ - 26.03.08 12:06 pm I did not need a static IP address to create my own blog on my home PC. Why then do I need one to host my own website?

cor - 26.03.08 4:06 pm QQ, you don't. And no one implied that you did. ;o) (or

sb - 27.03.08 7:56 pm Thanks for your fast response! I forwarded port 25192 on my router (Siemens Wireless ADSL) to port 25192 of my static local IP 192.168.1.2. (I've set my DHCP range to 192.168.1.3 -> 192.168.1.255)

8 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

The router manual said something about adding filter rules, so after googling them, I went to the Windows Firewall of my LAN-connection panel, tabbed to "Exceptions" and added my port to the list of programs and services (? also ports obviously then) that are NOT to be blocked. Is this correct? Saved my router configuration, updated my DUC. Set up my server program to listen for incoming connections on 25192, and to send back some html code (for now). When I entered my dynDNS address and the port into IE (http://x.no-ip.org:25192), I got: Cannot display web page. Cannot display web page content, find a suitable program? Of course I didn't find anything My server program also did not recieve any connection. Then I connected using WinSock to x.no-ip.org using that port (and TCP) and I get error message 100061: server (actively) refused connection. (replacing x.no-ip.org by my external router address doesn't do anything better either (ofcourse)) Tested my server program and it worked when simply connecting to my own pc with port 25192. .. help? Thanks! You are awesome!

cor - 28.03.08 2:26 am sb, you seem to have the gist of it now, but are perhaps sticking on a couple of the details.. Firstly, you are not going to be able to test this effectively from inside your LAN. I recommend you use my port probe, which lives on the corz.org server. Then you need to go through the whole route (thinking like a packet of data, remember) and probe, probe, probe at every step you take. If you don't SEE changes, then there weren't any. Port-forwarding is usually straightforward enough on most routers, though sometimes not. Read the port-forwarding section in your router's help file, and ensure you aren't missing something. I am concerned about your statement "Saved my router configuration, updated my DUC". Why do you need to update your DUC? A Dynamic Update Client should update automatically, every time your external IP changes (and if it doesn't, get another DUC, because yours is useless), hence the name "DUC". I repeat,

9 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

you should not have to update a DUC, ever. All a DUC does, is tells dyndns.org (or no-ip.com, in your case) that your external address has changed, so that your dynamic IP service provider (no-ip.com) can update their name servers with your current IP. That's all. My firewall box (IPCop) updates them all whenever I connect/reconnect to the net - it has a DUC (and a darned good one) built-in. I haven't looked at that page for a year but my dynamic host names are always up-to-date. While you are setting this up, you might want to turn off the DUC altogether, go to http://corz.org/ip, and input that IP directly into your hosts at no-ip.com (I assume they still allow you to update your current IP from the web). Until you get things working, remove ALL complexities, and potentially problematic systems from the picture. A DUC is useful if you run a server, but you don't have a server running 100% yet, so put it away until you do. Same goes for firewalls between the probe and the server. Switch them OFF. And if you really are using the Windows built-in firewall, I recommend you don't switch it on again, ever. Disable the service altogether and get a real firewall, if you really must. Our data packet wants a clear path, from client (in this case my port probe) to server (on the local box @ 192.168.1.2). Forget no-ip.com for now, and use your raw IP address. Remove all complexity, and test again. Once it's working, you can again enable firewall, DUC, etc, one-by-one, and test (probe) after each and every step. That way, if something is causing issues, it will be easily discovered. There are LOADS of tools online that can, as part of their operation, attempt to connect to your server from "outside"; use them. For example, the W3C html validator (wee button at the bottom-left of all the pages here), or site-uptime's quick-check, and so on and on. If you need to know what a real outside connexion will look like from the other end, these, and the thousands of other, similar tools, are invaluable. Strangely, most people don't think to use them in this way. Finally, once everything is 100%, with all firewalls in-place, DUC enabled and working (automatically!) you can edit your dynamic host names into your local hosts file, and work with the no-ip.com address inside and outside your LAN. For more info about that, follow the links I dropped into my previous post. for now.. ;o) (or

overburn - 29.03.08 12:34 am

10 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

will this affect any computers in your network bar your own. E.G you configure an external IP thats static, and downstairs computers connection has problems?

cor - 29.03.08 6:10 am overburn, YOU CANNOT CONFIGURE A STATIC EXTERNAL IP! As I said, in the article..
If you were actually wondering how to get a static IP for your whole internet connexion; aka. external IP; perhaps to run some live website or interesting server from your home or office, well, that's not something we mere mortals can do from our side of the router. You will need to talk to your ISP

You can only configure static IP's for your local machines, the ones inside your LAN, which is what this page is about. Note: it's usually best to actually read a page before asking questions about it! ;o) (or

asfand - 31.03.08 1:38 pm very nice article. Just wanted to say, some people DO 'need' a static external IP :p Why? Well for p2p softwares like DC++. It's not enough forwarding ports, you need a static external IP too...one which I don't possess. Other reasons are purely convenience; for games etc...letting friends know which IP to connect to can be a bit of a hassle if you have to go to corz.org/ip or dslreports.com/whois :( Either way, if you have anyway of making DC++ work without the user having to type in a new IP address everytime (providing you've reconnected since the last usage), I would be eternally grateful to you. Seriously. Eternally grateful. Who wouldn't want that? :p

cor - 31.03.08 2:03 pm asfand, did you miss the notes under the article?

11 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

The solution is there. ;o) (or

asfand - 31.03.08 6:48 pm I didn't no; I know about calling the ISP to check if they can offer a static external IP address etc etc. I just threw that out there to see if you were maybe a user of dc++ and knew how to get round that requirement You didn't have to be so dismissive :(

cor - 01.04.08 6:09 pm I meant, did you read this bit..


Note: Not all ISP's offer this service, and those that do will usually charge a premium. However.. Most people do not need this! Even those that think they do, or have been told they do. Perhaps you simply need to get yourself a dyndns.org or no-ip.com address, and a DUC.

Which as I see it, is the solution. No? The only way I can imagine that it would NOT be the solution is if the software in question (dc++, game, etc.) required a dotted decimal IP (i.e. 172.149.39.299), and had no way to input a proper host "name". But that would be an issue with the application, and they should fix that. Forcing thousands of users to pay through the nose for something they don't actually need, is not clever. ;o) (or

new2linuxWebServer - 05.04.08 1:26 am Ok I am one of those "1 or 2 linux users" that do not yet understand how IP addresses work. I am trying to build a web server that will serve web sites to the net. I have a linux os and xampp server and am at the point where I have just set up a firewall and have given permissions for ports "80 and 21" and all tests say the server is working but I can not figure out how to connect to the server from the internet. In the book I am reading

12 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

(The Official Damn Small Linux Book) it instructs me to get the Ip address by entering the following at the command line: /sbin/ifconfig |grep inet and I did and it gave me: 192.168.x.xx (x's are numbers)and It said to test the server by entering that IP into another computers browser and I did and it doesn't work:( Can You perhaps tell me why or what I may be doing wrong? I would really appreciate it! thanks, new2linuxWebServer

cor - 05.04.08 1:55 am Don't get me wrong, *lots* of Linux users don't understand how IP's work, but most are more familiar with how to set their own; generally it's part of the setup procedure, though many these days would likely opt for dhcp. Anyway.. The grep command would work if your server was directly connected to the internet, but I suspect you are going through a NAT/router/etc, which is why it gives you a local (private) ip, 192.168.1.3, or whatever. Remember..
** There are other private ranges, too, but most people don't need to know about those, 192.168.1.something is what most folk use, and though thousands of millions of machines in the world have 192.168.1.something as their private IP address, they don't interfere with each other because they are behind NATs and other gateways; from the outside, we only see the public IP address, aka. "external IP".

What you need to know, is your public (aka. "external") ip address, which is currently 99.164.*.*. See the useful links section; not only is there a link to my handy "what is my ip" script at http://corz.org/ip but right above there, it will tell you what your ip actually is, right now. That's the ip you want the other person to put in their browser. I just tested it, by the way - it timed out. Before you get to this stage, though, you want to ensure everything is working 100%, locally, from 192.168.*.*. If you can't access the server from there (or http://localhost/ if you are on the same box) then it's unlikely that anyone will be able to reach it from outside. ;o) (or

new2linuxWebServer - 05.04.08 5:11 am Wow thnks for getting back to me so fast! And Thnx for the tips! I used the tool to get my external IP addr. Thanks I was using

13 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

the wrong one. So I tried the other one and it is not working either:( I tried: http://localhost and that works from the box. I am trying to access the server from another laptop that is on a seperate wireless internet connection. Should I be using a static IP address in this case? I don't think so, but don't know what else to try...and the book I am using for refferance (The Official Damn Small Linux Book) also suggests that I need a static IP and I see your article suggests otherwise...Yes I am using Damn Small Linux as an os. ....And you said that it is giving me the local IP addr. because I must be going thru a NAT/router.....and yes I am going through a Motorola 2210 modem and I have AT&T dsl servive for the server box. So if "http://localhost" works from the box, what can be stopping it from being accessed from the net? I have explored the sever locally to the best of my ability and as far as I can tell everything seems to be okay. I would appreciate it if you could provide further assistance. I have tried getting help from Apachefriends and DSL to no avail....thnx again, new2linuxWebServer

cor - 05.04.08 1:02 pm Either the motorola (probably not, if it's just a simple modem, though very likely, if it's a router) or the server box is doing firewalling. If it's the motorola doing the firewalling, you will need to forward port 80 to the DSL box. This area of the site is filled with information about port forwarding routers, though not specific to your device, it might be worth reading, help you get a handle on what's going on. If the motorola is just a simple modem, and your DSL box is connected directly to the net, you'll need to look at its firewall, and ensure you are allowing connexions in. It uses iptables iirc, and the config is called "rc.firewall" It's confusing, speaking about DSL (Damn Small Linux) and DSL (Digital Subscriber Line) in the same sentence! Perhaps that's why you've not had a lot of assistance elsewhere. It might be easier to say you use a "Debian-based distro". Good luck! ;o) (or

leave a comment, become part of this site!

14 of 15

4/16/2008 5:47 AM

Get A Static IP! How to set a static ip address for your computer (for p2p...

http://corz.org/comms/hardware/router/static.ip.address.php

First, confirm that you are human by entering the code you see..
(if you find it difficult to read, refresh the page for a new code)

check it!

random word from corzblog: smoking

2008 corz.org 16.4.08 speedy gonzales timer say this page generated in 0.045 seconds

gnikoms :golbzroc morf drow modnar

15 of 15

4/16/2008 5:47 AM

Você também pode gostar