日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

配置IPv4靜態路由示例

組網需求

如圖1所示,屬于不同網段的主機通過幾臺Switch相連,要求不配置動態路由協議,使不同網段的任意兩臺主機之間能夠互通。

圖1 配置IP靜態路由組網圖

華為交換機如何配置IPv4靜態路由

 

配置思路

采用如下的思路配置IPv4靜態路由:

  1. 創建VLAN并配置各接口所屬VLAN,配置各VLANIF接口的IP地址,實現相鄰設備網絡互通。
  2. 在各主機上配置IP缺省網關,在各臺Switch上配置IPv4靜態路由或者靜態缺省路由,實現不配置動態路由協議,使不同網段的任意兩臺主機之間能夠互通。

操作步驟

  1. 配置各接口所屬VLAN
  2. # 配置SwitchA。SwitchB和SwitchC的配置與SwitchA類似。
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10 30
[SwitchA] interface gigabitethernet 1/0/1
[SwitchA-GigabitEthernet1/0/1] port link-type trunk
[SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet1/0/1] quit
[SwitchA] interface gigabitethernet 1/0/2
[SwitchA-GigabitEthernet1/0/2] port link-type access
[SwitchA-GigabitEthernet1/0/2] port default vlan 30
[SwitchA-GigabitEthernet1/0/2] quit
  1. 配置各VLANIF接口的IP地址
  2. # 配置SwitchA。SwitchB和SwitchC的配置與SwitchA類似。
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 10.1.4.1 30
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 30
[SwitchA-Vlanif30] ip address 10.1.1.1 24
[SwitchA-Vlanif30] quit
  1. 配置主機
  2. 配置主機PC1的缺省網關為10.1.1.1,主機PC2的缺省網關為10.1.2.1,主機PC3的缺省網關為10.1.3.1。
  3. 配置靜態路由
  4. # 在SwitchA配置IP缺省路由。
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
  1. # 在SwitchB配置兩條IP靜態路由。
[SwitchB] ip route-static 10.1.1.0 255.255.255.0 10.1.4.1
[SwitchB] ip route-static 10.1.3.0 255.255.255.0 10.1.4.6
  1. # 在SwitchC配置IP缺省路由。
[SwitchC] ip route-static 0.0.0.0 0.0.0.0 10.1.4.5
  1. 驗證配置結果
  2. #查看SwitchA的IP路由表。
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
 Destinations : 7 Routes : 7
 
Destination/Mask Proto Pre Cost Flags NextHop Interface
 
 0.0.0.0/0 Static 60 0 RD 10.1.4.2 Vlanif10
 10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif30
 10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif30
 10.1.4.0/30 Direct 0 0 D 10.1.4.1 Vlanif10
 10.1.4.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
  1. # 使用ping命令驗證連通性。
[SwitchA] ping 10.1.3.1
 PING 10.1.3.1: 56 data bytes, press CTRL_C to break
 Reply from 10.1.3.1: bytes=56 Sequence=1 ttl=253 time=62 ms
 Reply from 10.1.3.1: bytes=56 Sequence=2 ttl=253 time=63 ms
 Reply from 10.1.3.1: bytes=56 Sequence=3 ttl=253 time=63 ms
 Reply from 10.1.3.1: bytes=56 Sequence=4 ttl=253 time=62 ms
 Reply from 10.1.3.1: bytes=56 Sequence=5 ttl=253 time=62 ms 
 --- 10.1.3.1 ping statistics ---
 5 packet(s) transmitted
 5 packet(s) received
 0.00% packet loss
 round-trip min/avg/max = 62/62/63 ms
  1. # 使用Tracert命令驗證連通性。
[SwitchA] tracert 10.1.3.1
 traceroute to 10.1.3.1(10.1.3.1), max hops: 30 ,packet length: 40,press CTRL_C to break
 1 10.1.4.2 31 ms 32 ms 31 ms
 2 10.1.3.1 62 ms 63 ms 62 ms

配置文件

  • SwitchA的配置文件
#
sysname SwitchA
#
vlan batch 10 30
#
interface Vlanif10
 ip address 10.1.4.1 255.255.255.252
#
interface Vlanif30
 ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet1/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
#
interface GigabitEthernet1/0/2
 port link-type access
 port default vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
#
return
  • SwitchB的配置文件
#
sysname SwitchB
#
vlan batch 10 20 40
#
interface Vlanif10
 ip address 10.1.4.2 255.255.255.252
#
interface Vlanif20
 ip address 10.1.4.5 255.255.255.252
#
interface Vlanif40
 ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet1/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
#
interface GigabitEthernet1/0/2
 port link-type trunk
 port trunk allow-pass vlan 20
#
interface GigabitEthernet1/0/3
 port link-type access
 port default vlan 40
#
ip route-static 10.1.1.0 255.255.255.0 10.1.4.1
ip route-static 10.1.3.0 255.255.255.0 10.1.4.6
#
return
  • SwitchC的配置文件
#
sysname SwitchC
#
vlan batch 20 50
#
interface Vlanif20
 ip address 10.1.4.6 255.255.255.252
#
interface Vlanif50
 ip address 10.1.3.1 255.255.255.0
#
interface GigabitEthernet1/0/1
 port link-type trunk
 port trunk allow-pass vlan 20
#
interface GigabitEthernet1/0/2
 port link-type access
 port default vlan 50
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.5
#
return

分享到:
標簽:路由 靜態 IPv4
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定