日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

静态路由默认路由的配置

發(fā)布時(shí)間:2023/12/9 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 静态路由默认路由的配置 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

靜態(tài)路由實(shí)驗(yàn)

負(fù)載均衡的一點(diǎn)是個(gè)人理解,有不正確之處歡迎批評(píng)指正。?????????????

R1配置:

s0/0/0口:193.1.1.9/30(本地)?? next-hop 193.1.1.10/30? point-to-point link
F0/0設(shè)置子接口:F0/0.1 172.17.115.1/24 VLAN1?? F0/0.5 172.17.110.1/24 VLAN6
靜態(tài)路由配置:
ip route 192.168.1.0 255.255.255.0? 193.1.1.10
ip route 192.168.2.0 255.255.255.0? 193.1.1.10
ip route 193.1.1.16 255.255.255.252? 193.1.1.10
ip route 1.1.1.0 255.255.255.0? 193.1.1.10
ip route 10.10.0.0 255.255.0.0? 193.1.1.10

S1配置:VLAN 1?? ,VLAN 6? F0/10? F0/11?
PC1:172.17.115.11/24
PC2:172.17.110.11/24

R2配置:? DCE
LOOPBACK口:192.168.1.1/24?? 192.168.2.1/24
s0/0/0口:193.1.1.10/30(本地)?? next-hop 193.1.1.9/30? point-to-point link
s0/0/1口:193.1.1.17/30(本地)?? next-hop 193.1.1.18/30? point-to-point link
靜態(tài)路由配置:
ip route 172.17.115.0 255.255.255.0? 193.1.1.9 1/2(管理距離,如有備用路由時(shí))
ip route 172.17.110.0 255.255.255.0? 193.1.1.9
ip route 1.1.1.0 255.255.255.0? 193.1.1.18? permanent (加此參數(shù),則為靜態(tài)路由使用的接口出現(xiàn)故障,仍將把路由保存在跌幅表中)
ip route 10.10.2.0 255.255.0.0? 193.1.1.18

R3配置:默認(rèn)路由

LOOP口:1.1.1.1/24??
F0/0口:10.10.2.1/16
s0/0/1口:193.1.1.18/30(本地)?? next-hop 193.1.1.17/30? point-to-point link
靜態(tài)路由配置:
默認(rèn)路由 ip route 0.0.0.0 0.0.0.0 193.1.1.17
SERVER:10.10.9.61

最終實(shí)現(xiàn)全網(wǎng)互聯(lián)。

?

R1配置:Router>ena
Router#conf t
Enter configuration commands, one per line.? End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#no shu?????????? 需要先把接口啟用

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#int f0/0.1?????????????? 創(chuàng)建并進(jìn)入子接口f0/0.1?

%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up??????? 子接口創(chuàng)建即啟動(dòng),不需要手動(dòng)配置。

Router(config-subif)#encapsulation dot1q? 1????? 配置封裝為dot1q。并與VLAN 1相關(guān)聯(lián)
Router(config-subif)#ip add 172.17.115.1 255.255.255.0?? 配置子接口IP

Router(config-subif)#int f0/0.5

%LINK-5-CHANGED: Interface FastEthernet0/0.5, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.5, changed state to up
Router(config-subif)#encapsulation dot1q? 6
Router(config-subif)#ip add 172.17.110.1 255.255.255.0
Router(config-subif)#exi
Router(config)#int s0/0/0
Router(config-if)#ip add 193.1.1.9 255.255.255.252
Router(config-if)#no shu

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#exi
Router(config)#ip route 192.168.1.1 255.255.255.0 193.1.1.9
%Inconsistent address and mask???? 出錯(cuò)是因?yàn)樾枧渲媚康木W(wǎng)段,非主機(jī)地址
Router(config)#ip route 192.168.1.0 255.255.255.0 193.1.1.10 通過下一跳IP193.1.1.10到達(dá)192.168.1.0網(wǎng)段的靜態(tài)路由。
Router(config)#ip route 192.168.1.0 255.255.255.0 193.1.1.10???? 2?? 管理距離默認(rèn)為1,設(shè)置為2即為備用路由。

Router(config)#ip route 192.168.1.0 255.255.255.0 193.1.1.10????1? 管理距離默認(rèn)為1,設(shè)置為1或者不設(shè)置即實(shí)現(xiàn)負(fù)載均衡。負(fù)載均衡這點(diǎn)是個(gè)人理解,靜態(tài)路由基于管理距離進(jìn)行路由。

Router(config)#ip route 192.168.2.0 255.255.255.0 193.1.1.10
Router(config)#ip route 193.1.1.16 255.255.255.252 193.1.1.10
Router(config)#ip route 1.1.1.0 255.255.255.0 193.1.1.10
Router(config)#ip route 10.10.2.0 255.255.255.0 193.1.1.10
Router(config)#exi

%SYS-5-CONFIG_I: Configured from console by console
Router#wr
Building configuration...
[OK]
Router#

S1配置:

Switch(config)#int vlan 1
Switch(config-if)#no shu

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

Switch(config-if)#exi
Switch(config)#int vlan 6
Switch(config-if)#no shu
Switch(config-if)#int vlan 1
Switch(config-if)#ip default-gateway 172.17.115.1
Switch(config)#int f0/10
Switch(config-if)#switchport access vlan 6

%LINK-5-CHANGED: Interface Vlan6, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan6, changed state to up
% Access VLAN does not exist. Creating vlan 6
Switch(config-if)#int f0/11
Switch(config-if)#switchport access vlan 6
Switch(config-if)#int f0/24
Switch(config-if)#switchport mode trunk
Switch(config-if)#int f0/2
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk native vlan 6????? 本地管理VLAN改為VLAN 6。我并未給VLAN6配置地址。這里只是說一下有這個(gè)方法可以更改。
Switch(config-if)#exi
Switch(config)#exi

?

?

R2配置:? DCE
Router(config)#int s0/0/0
Router(config-if)#ip add 193.1.1.10 255.255.255.252
Router(config-if)#no shu

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

Router(config-if)#clock rate 64000??????配置時(shí)鐘速率為64000做為DCE端???
Router(config-if)#exi
Router(config)#exi

Router(config)#int s0/0/1
Router(config-if)#ip add 193.1.1.17 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#no shu

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
Router(config-if)#exi
Router(config)#int loopback 1?????????????? 創(chuàng)建環(huán)回接口。默認(rèn)已啟用

%LINK-5-CHANGED: Interface Loopback1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#int loopback 2

%LINK-5-CHANGED: Interface Loopback2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback2, changed state to up

Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#exi
Router(config)#ip route 172.17.115.0 255.255.255.0 193.1.1.9
Router(config)#ip route 172.17.110.0 255.255.255.0 193.1.1.9
Router(config)#ip route 1.1.1.0 255.255.255.0 193.1.1.18
Router(config)#ip route 10.10.0.0 255.255.0.0 193.1.1.18
Router(config)#exi

%SYS-5-CONFIG_I: Configured from console by console
Router#wr
Building configuration...
[OK]
Router#
?

?

R3配置:默認(rèn)路由

Router(config)#int loop 1

%LINK-5-CHANGED: Interface Loopback1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

Router(config-if)#ip add 1.1.1.1 255.255.255.0
Router(config-if)#int f0/0
Router(config-if)#ip add 10.10.2.1 255.255.0.0
Router(config-if)#no shu

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

Router(config-if)#int s0/0/1
Router(config-if)#ip add 193.1.1.18 255.255.255.0
Router(config-if)#no shu

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to up

Router(config)#ip route 0.0.0.0 0.0.0.0 193.1.1.17?? 默認(rèn)路由:所以流量通過下一跳193.1.1.17發(fā)送
Router(config)#exi

%SYS-5-CONFIG_I: Configured from console by console
Router#wr
Building configuration...
[OK]
Router#

?

配置完畢。測試全網(wǎng)互聯(lián)正常。

本文轉(zhuǎn)自 ?還不算暈 ?51CTO博客,原文鏈接:http://blog.51cto.com/haibusuanyun/511035

總結(jié)

以上是生活随笔為你收集整理的静态路由默认路由的配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。