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 74.125.45.100, and typing http://74.125.45.100/ 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 (your router is probably doing NAT, too, and needs your computer to have an IP address, so it knows where to send your data packets). However, dhcp is not an ideal setup; if there is any interruption in the computer's network connexion to the router (you reboot your PC, for instance), a completely new IP address may be assigned1.
For general (beginner's) use, dhcp is just fine, because it's easier; generally works "out of the box", 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 your next reboot, you will need to get a static IP on your computer, 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!
okay, let's do it!
Okay, so 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".
HOWEVER, if your router uses 192.168.0.something, or 10.0.0.something, or something else from the private IP ranges..
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
..then don't hesitate to use THAT instead of the 192.168.1.something addresses I use in my examples, that's what most routers use, but not all. Do check.
The best way to know what subnet your router uses, and thereby which IP to use, is to look and see what IP it has currently assigned to your computer. In Windows, it's in the Support tab of the connexion's Status dialog. A netstat command will get you the same information (and more) on most platforms, perhaps netstat -n. Your router's web interface will likely have all this information, too.
Remember to disable dhcp in your router before you start assigning static IP's.
Alternatively, 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 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..
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 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..
The Router..
Firstly, you don't have to mess with ANY of your computer's network settings, ever. Because the router is always going to dole out the exact same address to that computer, the usual DHCP settings will work fine. Your computer asks for any address, and always gets given the exact same one.
It's not possible to give many specifics, because each router is different, but I can tell you that if you use IPCop as your gateway (A Very Good Idea), it's as simple as clicking one of connexions in the "Current dynamic leases" list, and pressing "Create fixed lease", in the DHCP server page. Two clicks, and you're set for life!
You even can reinstall your computer's operating system, reboot, and there's your static IP again!
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, aka. "WAN IP"; perhaps to run some live web site 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. Instead, perhaps you simply need to..
- Note: you can always get your current external IP address, a-la "what's my IP", except in plain text, right here. Very handy for automatic shell scripts, and more. Right now, it's 38.107.191.99.
references:
1. This is very similar to the way you get a new external IP whenever you dial-up to the internet (some folks still do that) or disconnect your ADSL for a few minutes2 (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, no matter 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.
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, no matter 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 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.
Comprehensive article about the magic of the Domain Name System.
FAQ..
What is an IP Mask? And how do they work?
The IP Mask simply describes which parts of an IP address are not going to change.IP addresses are currently 32 bit, expressed as four sets of 8-bit numbers (0-255), or "octets". Simply, 255 means none of the bits can change, 0 means all of the bits can change (it can also be any number in between). What sometimes confuses, is that IP Masks can be expressed in two different ways..
IP: 192.168.0.<some valid number here>, Mask: 255.255.255.0
and..
192.168.0/24
Are exactly the same. While the first is, if you understand what I've said so far, fairly obvious; the second needs a little explanation.
If you remember that IP addresses are 32 bits, 4 sets of 8-bit numbers, you might realize that the second number simply states how many of those bits will be masked; in this case, 24 of the 32 are masked (cannot change), which is the first three sets, i.e. 255.255.255.0.
Any address using this mask, will be 192.168.0.something
See?
What's the difference between a public and private IP Address?
We did this! Okay, in short, your GATEWAY has your Public IP address, and your desktop computer (and any other machines inside your home/organization) have private IP Addresses. Simply put; it's outside and inside. Anyone "out there" can see your public IP, but only machines inside your own network know each other's individual private IP addresses... So, let's say a packet of data from "out there", is trying to reach your machine; it could be a legitimate connexion from a client, maybe an FTP client, or some game player, or script-kiddie, or whatever. It leaves their machine, and starts its journey, hop-to-hop, attempting to get to yours.
"Out There", is the internet. When you first connected to the internet, via your ISP's backbone, they assigned your connexion an IP address (or more than one, in some cases) from a large pool of IP Addresses they own. Any machine sending you a packet of data can reach you at this IP.
Some folk pay for a static IP, most folk get a dynamic IP; that is, whatever's currently available from the ISP's IP pool, but either way, whatever IP your ISP gives your connexion becomes your Public IP Address. Every time you access a web page, or FTP site, or game server, or announce yourself to a torrent tracker, or anything; that is the IP Address they see at the other end of the connexion, and that is the address they will send the packets back to. This is your Public IP Address.
Up until that packet reaches your gateway machine, it is in the public domain. Anything could happen to it. Once that packet hits your gateway machine, it enters the private domain and what happens next, is up to you..
If your gateway machine is a router, or better yet, a dedicated gateway appliance like IPCop, or Smoothwall is, then you have an array of possibilities. The packet may be on a port you don't know, or don't allow, and may be immediately dropped by your gateway's firewall.
Or it may be on a port your gateway machine recognizes, like the return data from a web page you requested, or your torrent port, or whatever, and the gateway device will have been programmed to forward that packet on to a Private IP Address, another machine inside your network, your desktop, or wherever. The gateway's firewall usually does most of this automatically, sorting out which machines asked for what data, but can also be programmed to forward specific traffic to specific machines, for example, when we create port-forwarding rules for P2P clients on our desktop computers.
Your Private IP Address is known only to machines inside your own network. If you have lots of machines inside your network, they will each have different private addresses, and with a secure gateway, none of these addresses can ever be seen from the outside (unless you hand it out, for example, in your email headers).
This is why if you broadcast your Private IP to a distant server, e.g. 192.168.1.3; the requested data would never return, having been sent to a machine most likely sitting in the exact same building as the distant server, if such a machine even exists.
I want to host a REAL domain! A REAL site! I NEED an external Static IP!.. Don't I?
No, so long as your hardware (computer/network/connexion/bandwidth allowance) can handle whatever kind of site you plan to host, it's easy enough to point a proper TLD* at a dynamic IP address. While not recommended for mission-critical applications (there will always be a brief spell after you are assigned a new IP, where the name still points to the old IP - these days increasingly briefer, as DNS systems improve), hosting a "real" domain from a dynamic IP is most definitely doable.Once you have purchased (registered) your domain name, you simply need a way to keep it in sync with your ever-shifting dynamic public IP address.
Check out zoneedit.com, a free service which does exactly that. Just like dnydns.org et al, you run your DUC and it keeps your domain name pointing at your IP address. And if you head along to namecheap.com, you can even register your domain, and setup dynamic DNS all at the same time. This is a fine place to add that I consider namecheap to be the best domain registrar in the world.
* okay, technically only the "com/org/net/etc." part is the actual TLD, but the acronym has dropped itself into common parlance meaning "a proper (not-sub) domain", like "corz.org" or "ampsig.com" is. Okay, I might have pushed a little. ;o)
<Insert any question here>
When troubleshooting network issues, I usually get my solutions following one simple rule.. "Think like a packet of data". As breathtakingly simple as this sounds, imagining yourself as a packet of data, traveling from A to B is the fastest way to figure out where the trouble lies. That's all there is to it! Try it; you will not be disappointed with the results.Troubleshooting..
A number of things can go wrong when trying to configure a static IP on your local machine.The most common issues are..
- A second network adapter on your computer already has that IP address assigned to it.
Note: Firewire (aka. 'IEEE 1394') adapters usually get automatically setup as network adapters in Windows. Unless required, it is generally best to disable these interfaces.
- Another computer on your local network already has the IP you are attempting to assign.
Another Very Good Reason to configure all your static IPs at your router, and leave the individual puters' default DHCP settings as-is.
- You do not have sufficient security privileges to make such a change (i.e. you are not the Administrator/admin user)














Before you ask a question..
Firstly, read this at least once in your life. I insist!
NOTE: THIS IS NOT A COMMUNITY. And I am not your free tech dude.
If you can't be bothered to read the article, I can't be bothered responding. Capiche? I do read all comments, though, and answer questions about the article. I'm also keen to discuss anything you think I've missed, or interesting related concepts in general.
Questions which having nothing to do with local Static IP addressing will be deleted, which also doubles as your answer! This also goes for questions asking for an email reply.
If you are still sure that you want to post your own, personal, tech question, then please ensure that you first, either..
a) Have read the article (above) and have tried "everything" yourself; or else..
b) Pay me. The PayPal button is at the top right of the page.
Thanks a lot. I've learned a lot about Static IP address from your article!!
now I have to change my private IP because they found about my original one by means of a trojan I guess .when ı logged on to their site.How do I do that ?? if you help I would be grateful
Thanks so much for taking the time to write this article. It has made so many things clear to me in plain easy to understand English. Thank you.
first, thanx for the artical it's help soooo much on my project , but my question how can i provide static ip addresses to all the users of a computers in a LAN
Hi great article, clearly written and with humour. I'm using Windows 7 and in the LAN Connection / Properties screen I don't see TCP/IP on its own. Instead I see IPv4 Address (192.168.0.3). Is this the setting that needs to be changed? And do I need to do anything about the Link-Local IPv6 Address? The Connection screen says IPv4 Connectivity: Internet and IPv6 Connectivity: No network access, so I guess not (but I don't like to guess). Thanks for your help.
Keith, the instructions on this page apply to IPv4 networking. IPv6 isn't fully implemented, yet, and you don't have to put anything into those inputs.
nana, you simply repeat the instructions for all the computers on your LAN. NOTE: If you have a lot of puters, it makes sense to do this at the router. That way you have one central configuration you can backup and restore in one single place, as opposed to dozens of separate configurations on as many machines. That's assuming your router can do this. If not, consider IPCop or similar.
Nowadays I always recommend folk setup their static IP's from the router wherever possible (as explained in the article). This way you never have to worry about configuring any of your individual machines. The router is also the place where the port-forwarding rules live, so again, its backup is also the LAN configuration backup, all-in-one.
metin5308, every time you visit any web site, you reveal your IP. If you didn't, how would the server know where to send the pages? If this bothers you, use a proxy.
MyName, perhaps the 1-99 range is reserved for DHCP. If you don't need DHCP, disable that and try again.
;o) Cor
why the first IP (here it is 192.168.1.1) assigned to the default gateways. Is there any specific reason because most of them I have seen is told to assign the first network ip to the gateways. Is there something to do with dhcp.
thank for all the info but you haven't said anything about DNS numbers where did you get alternate DNS number and why is it diffrent can you explain a bit more about each boxes thanks.
can you make a guide dor my DS/DSi and other console?
[
thanks, but with this solve my problem of sending mails
Great site, very original, color combination and layout.
I rarely leave comments at sites but with yours I couldnt help myself, cause i guess i found it
inspirational. nice to see talented and accomplished individuals sharing on the internet.
but anyways don't mean to ramble on, just to say way to go and wish you all the success with your endeavors.
hi. it is really hard for me to connect to facebook at times
and i read in one site that i need to change my external IP address
to something nearer where facebook is located.
the site they can change it for a fee.
how can i change it for free?
thnx
when you configer static ip configer stpes
Informations regarding Networking
great article.
i'm trying to find wether my ipaddress internet.. is static or dynamic so i Can switch my moneris debit machine from the telephone line to an internet port. where abouts can i find static or dynamic or simply explain the difference
hi
hello, I use Windows XP. I have a wireless printer on my network. I use DHCP for all the devices on my network, so everyone in the house can painlessly add and remove devices. However, to communicate with the printer my machine and every other machine needs to know its IP address and that must not change. This requires static. Your tutorial above says that to use static IP addressing for *any* machine I must turn off DHCP completely. Is there any way to give the printer a static address but not turn off DHCP - its too convenient and works fine for everything else
cheers
Just wanted to say that this was the most well-written article on static and private IPs that I've ever seen. Thanks very much!
Hi,
I am so happy to have found this article after searching the web for days literally. I've got or had my system set up with static IP addresses (a desktop xp pro, two wireless laptops 32 & 64 bits, and several printers etc.) All printers HP used to get booted off network until we set up the static IP addresses. I had reaad about it in an obscure little article I belive in PC World, not a large piece at all. I am so thankful for the explanations given here. This is what I was looking for.
I would find it helpful to know why even though one has static IPs one can still have a item booted off the network? For example I understand that if one unplugs ones modem here and there or is it the router...becasue the pc or is it the pcs...are being booted offline...well you get the idea...that this can casue the staticity (like or hate this word?) to revert bcak to non static. I would like more info about this as well as on the DCHP settings and as one gentleman wrote, it must be disable in order to have the static setting enabled. But I will take your word for it. LOL I just would like any more info that relates to this article eg. setting IP addresses. I'm not looking for tech support. Althouhg if I could find any it would be grand; I;ve been working on the printer being off the network for days now. Netgear charges 36.50 I think for each incident. My more knowledgable friend is so busy...busy...who isn;t busy today...but who has that kind of money every few weeks? Hence teh static setting, I get it. But when it doesn't work, there are reasons, those I would like to find someplace so I can try and fix this asap.
Anyway, nice chatting with you all, this is a nice informatie place to visit and I wish more knowledgable folks would putinfo like this up. I do but it is on birds, pain management anad grdeninv not on pcs. LOL C
I am so happy to have found this article after searching the web for days literally. I've got or had my system set up with static IP addresses (a desktop xp pro, two wireless laptops 32 & 64 bits, and several printers etc.)