Showing posts with label ip. Show all posts
Showing posts with label ip. Show all posts

Saturday, August 20, 2011

How to renew your computer’s IP Address for Windows

How a computer IP is assigned

The most common way to access the Internet for home users is through DHCP (Dynamic Host Configuration Protocol) a standard protocol ( RFC 1531 ) that assigns dynamic (changing) IP addresses to the host, this is done automatically and saves the ISP the need for human intervention, a computer can get a new IP address every time it reconnects to the network, DHCP keeps a central database with the IPs that have been assigned to avoid giving the same IP to different devices which would cause network problems with data packets not knowing what way to go.

Just because your old IP has been given away to someone else this doesn’t mean that your activities have not been logged and you are not traceable, a database with the customer ID linking him to the leased IP with times and dates at which that particular IP was assigned to the customer will be kept, either for troubleshooting or legal reasons, some ISPs could keep this information for years, possibly no more than two as data retention laws, where they exist, do not go that far.

Renew a computer IP disconnecting your router

A DHCP allocated address can be renewed wherever your ISP configuration servers decide it needs to be renewed, even while you surf the Internet (unconventional), or you can force your ISP to give you a new IP. Disconnecting the router (on/off button) for a couple of minutes will finish the IP lease,you are likely to get a new IP when you reconnect to the network and your old IP will have been assigned to someone else.

If you do not get a new IP address after disconnecting and reconnecting your router from the network, try to leave your router disconnected for longer, a few hours to make sure, best done overnight, your chances of being given a new IP by your ISP (DHCP) will improve the longer your device has been disconnected.

Renew a computer IP to using Windows cmd

To renew your computer’s IP address in Windows launch cmd, go to Windows search and type in cmd orcommand.com, make sure to run cmd as administrator otherwise you won’t be able to get a new IP.

Windows cmd command launch

Windows cmd command launch

At the command prompt type: ipconfig (click Enter) if you have more than one device connected to your router (wireless and Ethernet) type ipconfig /all (Optional step to see your current IP address)

ipconfig /all shows all connected media

ipconfig /all shows all connected media

At the command prompt type: ipconfig /release (click Enter)>>>>This step will disconnect you from the network and your computer IP address will show as “Media disconnected”

ipconfig release disconnect IP

ipconfig release disconnect IP

At the command prompt type: ipconfig /renew (click Enter) >>>>Now exit (type exit and click Enter) wait a couple of minutes for a new IP to be assigned to your computer

Windows ipconfig /renew gets new IP

Windows ipconfig /renew gets new IP

Renew computer IP using the router interface

Login into router administration launching your browser and typing in the router IP (normally http://192.168.1.1/), the router user and password could be admin:admin or something else depending on brand, enter your router brand on an Internet searcher to find out the default password.

Once inside the router management interface release your IP, every manufacturer has a different way to do this, there is no golden rule about where to find this setting, when you have found it, turn off the router, switches and all network cards, leave it off overnight and switch it back on the next day remembering to enter the router management interface once again to renew your computer IP.

Renew computer IP troubleshooting

Some ISPs assign IPs based on a device MAC address, in those cases the only for you to get a new IP will be changing your network card or using special software to fake your computer MAC address.

If you type ipconfig at the command prompt and see that your IP starts with 169.254.*.* then you are not connected to the Internet, Windows will assign you a 168.254.*.* IP when the computer can not connect to a DHCP server, this IP is called an APIPA address (Automatic Private IP Addressing).

If after disconnecting your router from the network overnight and reconnecting next day in the morning you still get the same IP call your ISP and ask them how long do you need to be disconnected in order to renew the computer IP.

Try disabling your firewall and antivirus if ipconfig /renew does not work as it can cause problems renewing your IP by blocking ports, in rare occasions it could also be that your network card drivers need to be updated.


Tq http://www.hacker10.com

Sunday, October 24, 2010

Howto: Ubuntu Linux convert DHCP network configuration to static IP configuration

Your main network configuration file is /etc/network/interfaces

Desired new sample settings:
=> Host IP address 192.168.1.100
=> Netmask: 255.255.255.0
=> Network ID: 192.168.1.0
=> Broadcast IP: 192.168.1.255
=> Gateway/Router IP: 192.168.1.254
=> DNS Server: 192.168.1.254

Open network configuration file
$ sudo vi /etc/network/interfacesOR$ sudo nano /etc/network/interfaces

Find and remove dhcp entry:
iface eth0 inet dhcp

Append new network settings:

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Save and close the file. Restart the network:
$ sudo /etc/init.d/networking restart

Task: Define new DNS servers

Open /etc/resolv.conf file
$ sudo vi /etc/resolv.conf

You need to remove old DNS server assigned by DHCP server:
search myisp.com
nameserver 192.168.1.254
nameserver 202.54.1.20
nameserver 202.54.1.30

Save and close the file.

Task: Test DNS server

$ host cyberciti.biz

Network command line cheat sheet

You can also use commands to change settings. Please note that these settings are temporary and not the permanent. Use above method to make network changes permanent or GUI tool as described below.

Task: Display network interface information

$ ifconfig

Task: Take down network interface eth0 / take a network interface down

$ sudo ifconfig eth0 downOR $ sudo ifdown eth0

Task: Bring a network interface eth0 up

$ sudo ifconfig eth0 upOR$ sudo ifup eth0

Task: Change IP address and netmask from command line

Activate network interface eth0 with a new IP (192.168.1.50) / netmask:
$ sudo ifconfig eth0 192.168.1.50 netmask 255.255.255.0 up

Task: Display the routing table

$ /sbin/route OR$ /sbin/route -n
Output:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localnet * 255.255.255.0 U 0 0 0 ra0
172.16.114.0 * 255.255.255.0 U 0 0 0 eth0
172.16.236.0 * 255.255.255.0 U 0 0 0 eth1
default 192.168.1.254 0.0.0.0 UG 0 0 0 ra0

Task: Add a new gateway

$ sudo route add default gw 172.16.236.0

Task: Display current active Internet connections (servers and established connection)

$ netstat -nat

Task: Display open ports

$ sudo netstat -tulpOR$ sudo netstat -tulpn

Task: Display network interfaces stats (RX/TX etc)

$ netstat -i

Task: Display output for active/established connections only

$ netstat -e
$ netstat -te
$ netstat -tue

Where,

  • -t : TCP connections
  • -u : UDP connections
  • -e : Established

Task: Test network connectivity

Send ICMP ECHO_REQUEST to network hosts, routers, servers etc with ping command. This verifies connectivity exists between local host and remote network system:
$ ping router
$ ping 192.168.1.254
$ ping cyberciti.biz

See simple Linux system monitoring with ping command and scripts for more information.

Task: Use GUI (Graphical Configuration) network Tool

If you are new, use GUI configuration tool, type the following command at terminal:
$ network-admin &

Above command is Ubuntu's GUI for configuring network connections tool.

Final tip - Learn how find out more information about commands

A man page is your best friend when you wanted to learn more about particular command or syntax. For example, read detailed information about ifconfig and netstat command:
$ man ifconfig
$ man netstat

Just get a short help with all command options by appending --help option to each command:
$ netstat --help

Find out what command is used for particular task by searching the short descriptions and manual page names for the keyword:
$ man -k 'delete directory'
$ apropos -s 1 remove

Display short descriptions of a command:
$ whatis rm
$ whatis netstat

Linux offers an excellent collection of utilities, which can be use to finding the files and executables, remember you cannot memorize all the commands and files ;)

kunkun-laptop .... ;)