4/01/2013

Configure Static IP on a Router

1) How to Configure Static IP address on a Router with any Cisco IOS Routers?
2) How to Configure Static IP address on a D-Link DIR-615 Router (General Firmware OS)? (Basic Router with some advanced features.)

Lets Start here.

Question 1 Answer here

Step 1: Open your Router with credentials (Telnet or Console), Complete user mode and privileged mode passwords.

After you open credentials your router command line windows should show these such a way.

Enter Telnet or Console Passwords if exits.


User Access Verification

Password:
Router>en
Password:

Step 2: Enter in to configuration mode.

Type "configure terminal" or "conf t"

Router#conf t
Router(config)#

Step 3: Enter your LAN ip address with this command line as follows.
There are two ways to configure here. Prefer as you wish.
-1) Configure to your public IP address directly.


Router(config)#ip nat inside source static tcp 192.168.20.2 7778 148.25.XX.XX 7778
            ###### or to your WAN Interface where ISP Ip is connected ######


-2) Configure to your WAN Interface.

Router(config)#ip nat inside source static tcp 192.168.20.2 7778 interface serial 0/0/0
                                                       ##### Serial 0/0/0 is already configured with WAN IP address #####

Some more examples for Remote Desktop
Router(config)#ip nat inside source static tcp 192.168.20.2 3389 interface serial 0/0/0
Router(config)#ip nat inside source static udp 192.168.20.2 3389 interface serial 0/0/0
That means i will open my remote desktop and type 148.25.XX.XX on remote desktop from any where in the world. That's it i am done here.

My Assumption here.......

-> 192.168.20.2 is your private IP address in your internal LAN network.
-> My Public IP is 148.25.XX.XX
-> You should define both public and private Port no's.
There are some well known port no's.
21      -Telnet
5900  -VNC
3389  -Remote Desktop
-> You add your own port no's as you wish with your application requirements.
-> Here 7778 is my application port no where i use this to public network access.
-> You should some times define both TCP & UDP in above assumption as per your requirements.

In the same way you can configure this to your public IP as per your application requirements.


Question 2 Answer here

Step 1: Open your router with your credentials.
(eg: Type 192.168.0.1 on your browser web address line for basic router only.)

Step 2: Go for advanced tab above and in the left panel select for Virtual Servers.


Name : As you wish
IP Address: 192.168.20.2 internal LAN IP where application is stored or if you want remote desktop to outside WAN
Public Port: As per application port
Private Port: As per application port
Protocol: Both tcp & udp
(If you are not sure with port no select the application name you want and click on "<<" this will automatically take your port no here.) 
Check on the left side check box or tick on it and click on save settings above.
Thats it you are done here.

Now from outside network open your public IP 148.25.XX.XX:77

See if your application works.