1. 程式人生 > >配置接口IP地址並通過靜態路由、默認路由配置實現全網互通。

配置接口IP地址並通過靜態路由、默認路由配置實現全網互通。

mage 基本 [1] 3.1 ip add ges view aac com

首先搭建一個新括撲環境,如下圖:技術分享圖片
配置pc機的IP地址,子網掩碼,網關及路由器的IP地址,
基本配置如下:
第一臺路由器
<Huawei>system-view //進入系統視圖
[Huawei]sysname 1//給路由器改個簡單易識別的名字
[1]interface GigabitEthernet 0/0/0//進入0/0/0接口
[1-GigabitEthernet0/0/0]ip address 192.168.1.1 24//配置IP地址
[1-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1//進入0/0/1接口
[1-GigabitEthernet0/0/1]ip address 192.168.2.1 24//配置IP地址
[1-GigabitEthernet0/0/1]quit//退出到用戶視圖
[1]ip routr-static 0.0.0.0 0.0.0.0 192.168.2.2//配置默認路由,下一跳地址
技術分享圖片
技術分享圖片
第二臺路由器:
<Huawei>system-view //進入系統視圖
[Huawei]sysname 2//給路由器改個簡單易識別的名字
[2]interface GigabitEthernet 0/0/0//進入0/0/0接口
[2-GigabitEthernet0/0/0]ip address 192.168.2.2 24//配置IP地址
[2-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1//進入0/0/1接口
[2-GigabitEthernet0/0/1]ip address 192.168.3.2 24//配置IP地址
[2-GigabitEthernet0/0/1]quit//退出到用戶視圖
[2]ip routr-static 192.168.1.0 24 192.168.2.1//配置路由訪問網段,子網掩碼24位,下一跳地址
[2]ip routr-static 192.168.4.0 24 192.168.3.1//配置路由訪問網段,子網掩碼24位,下一跳地址
技術分享圖片
技術分享圖片
第三臺路由器:
<Huawei>system-view //進入系統視圖
[Huawei]sysname 3//給路由器改個簡單易識別的名字
[3]interface GigabitEthernet 0/0/0//進入0/0/0接口
[3-GigabitEthernet0/0/0]ip address 192.168.4.1 24//配置IP地址子網掩碼24位
[3-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1//進入0/0/1接口
[3-GigabitEthernet0/0/1]ip address 192.168.3.1 24//配置IP地址子網掩碼24位
[3-GigabitEthernet0/0/1]quit//退出到用戶視圖
[3]ip routr-static 0.0.0.0 0.0.0.0 192.168.3.2//配置默認路由,下一跳地址
技術分享圖片
技術分享圖片
配置pc機的IP地址,子網掩碼,網關
技術分享圖片
技術分享圖片
配置完成後用pc1ping1.1、2.1、2.2、3.2、3.1、4.1、4.2測試全網連通性
技術分享圖片
技術分享圖片
技術分享圖片
技術分享圖片
技術分享圖片
技術分享圖片
技術分享圖片
配置完成全網連通

配置接口IP地址並通過靜態路由、默認路由配置實現全網互通。