Tuesday, June 14, 2016

How to configure static routes

To reach between two different networks you need routing, And one of the simplest way of accomplishing this, by use of static route. With Huawei routers and layer 3 switches you can also run static route. We going to configure static routing on following topology:
First of lets assign host name and IP address to the routers:

AR1


Assigning Host name:

<Huawei>system-view 
[Huawei]sysname AR1

Assign IP Addresses to the Interfaces
#
[AR1]interface GigabitEthernet 0/0/0

[AR1-GigabitEthernet0/0/0]ip address 10.1.12.1 24
[AR1-GigabitEthernet0/0/0]undo shutdown 
#
[AR1]interface GigabitEthernet 0/0/2
[AR1-GigabitEthernet0/0/2]ip address 192.168.1.1 24
[AR1-GigabitEthernet0/0/2]undo shutdown 
#

AR2

Assigning Host name:
<Huawei>system-view 
[Huawei]sysname AR2

Assign IP Addresses to the Interfaces
#
[AR2]interface GigabitEthernet 0/0/0

[AR2-GigabitEthernet0/0/0]ip address 10.1.12.2 24
[AR2-GigabitEthernet0/0/0]undo shutdown 
#
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/2]ip address 192.168.2.1 24
[AR2-GigabitEthernet0/0/2]undo shutdown 
#


Verification 

AR1










AR2










PC1 connected to AR1 can ping to its gateway IP but cannot ping to remote PC2. 





















And same true for the PC2 can ping its gateway IP but cannot reach to PC1.




















\
This is common behavior of all routers from different vendors. Because by default routers only know connected networks.

So lets move to next step and add static routes.

AR1

<AR1>system-view 

[AR1]ip route-static 192.168.2.0 255.255.255.0 10.1.12.2

AR2

<AR2>system-view 

[AR2]ip route-static 192.168.1.0 255.255.255.0 10.1.12.1

Verification
AR1

















AR2















Now LAN side of both routers can ping each other successfully.

PC1












PC2


No comments:

Post a Comment