pt单臂路由
今天给各位分享ospf单臂路由链路聚合的知识,其中也会对pt单臂路由进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
1、如何配置单臂路由与OSpF网络
2、用到的命令--[数通]
3、单区域ospf配置可以和单臂路由一起配置吗
4、在做一个OSPF的题目,但是实现不了全网都Ping通。
5、单臂路由+OSPF怎么配置
如何配置单臂路由与OSpF网络
Cisco单臂路由配置
单臂路由,即在路由器上设置多个逻辑子接口,每个子接口对应一个vlan。在每个子接口的数据在物理链路上传递都要标记封装。Cisco设备支持ISL和802.1q(dot1Q)协议。华为只支持802.1q。
DOT1Q和ISL的区别:DOT1Q是各类产品的VLAN通用协议模式,Dot1q是一种普遍使用的标准,适用所有交换机与路由设备。支持超过1024vlan,而ISL最多支持1024个vlan。ISL是CISCO设备的专用协议,适用于Cisco设备。ISL(Interior Switching Link)交换机间协议用于实现CISCO交换机间的VLAN中继。它是一个信息包标记协议,在支持ISL接口上发送的帧由一个标准以太网帧及相关的VLAN信息组成。
PC1: IP :192.168.3.1/24 GW:255.255.255.0
PC2: IP :192.168.4.1/24 GW:255.255.255.0
S1:
Switchenable
Switch#vlan database
Switch(vlan)#vlan 30
Switch(vlan)#vlan 40
Switch# configure terminal
Switch(config)#int fastEthernet 0/1
Switch(config-if)#switchport access vlan 30
Switch(config-if)#int f0/2
Switch(config-if)#switchport access vlan 40
Switch(config-if)#int f 0/24
Switch(config-if)#switchport mode trunk (把该接口设置为trunk模式)
Switch(config-if)#switchport trunk allowed vlan all (运行所有vlan通过)
如果要把交换机的多个端口划到一个vlan下用如下命令:
Switch-1(config)#interface range fastethernet 0/1 -10
Switch-1(config-range)#switchport access vlan 30
RT1:
Routerenable
Router#configure terminal
Router(config)#int fastEthernet 0/0.1 (进入子接口)
Router(config-subif)#encapsulation dot1Q 30 (封装dot1Q协议,建立与vlan30的关联)
Router(config-subif)#ip add 192.168.3.254 255.255.255.0
Router(config-subif)#int f 0/0.2
Router(config-subif)#encapsulation dot1Q 40 (封装dot1Q协议,建立与vlan40的关联)
Router(config-subif)#ip add 192.168.4.254 255.255.255.0
Router(config-subif)#int f 0/0
Router(config-if)#no shutdown (启动f0/0的接口,包括所有子接口)
完成。Vlan30能与vlan40互相通讯。
配置OSPF,带图连接:
用到的命令--[数通]
一、STP
在交换机操作:
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]stp port priority 0 ###修改接口优先级
[SW1]display stp ###查看STP协议的状态
CIST Bridge 值和CIST root一致,则为root
[SW1]display stp brief ###查看STP端口角色和端口状态
[SW1]stp mode stp ###修改STP模式
[SW1]stp priority 0 ###修改STP优先级
int g0/0/1
[SW1]stp cost 20000 ###修改路径开销
二、RSTP
边缘端口:
作用: 接口up,立即进入转发状态
a.系统视图:
[SW1]stp edged-port default ###将所有端口设置为边缘端口
b.接口下:
[SW1]interface GigabitEthernet0/0/1
[SW1-GigabitEthernet0/0/1] stp edged-port enable
undo ###用于删除已经执行的命令
保护机制:
(1)根(root)保护:
用于防止root被抢占,在DP上配置
当DP端口收到更优BPDU时,会处于阻塞状态。如果30s内没有再次收到更优BPDU,回到转发状态。
配置:
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]stp root-protection ###在端口处配置根保护
(2)BPDU保护:
用于防止边缘端口收到BPDU报文,重新进行STP计算
edge-port收到BPDU报文,不会丧失edge-port
配置:
[SW1]stp bpdu-protection ###配置BPDU保护
三、IP路由
0~255 , 数值越小越优
direct 0
ospf 10
rip 100
static 60
四、静态路由
1.串行链路
a.ip route-static 目的网段 掩码 下一跳
b.ip route-static 目的网段 掩码 出接口
c.ip route-static 目的网段 掩码 出接口 下一跳
例子:
ip route-static 192.168.39.0 24 10.1.12.2
2.以太网链路
a.ip route-static 目的网段 掩码 下一跳
c.ip route-static 目的网段 掩码 出接口 下一跳
3.浮动路由
通过调整路由优先级实现
[R1]ip route-static 192.168.39.0 24 10.1.12.2
[R1]ip route-static 192.168.39.0 24 10.1.12.2 preference 70
4.默认路由
[R1]ip route-static 0.0.0.0 0 10.1.12.2
0.0.0.0/0 表示任意匹配
五、RIP(路由信息协议)
配置:
[R1] rip 1
[R1-rip-1] version 2 ###修改版本号
[R1-rip-1] network 192.168.1.0
[R1-rip-1] network 10.0.0.0
六、(1)OSPF配置
1.配置接口IP地址
2.激活OSPF进程
OSPF
3.进入区域下,宣告接口
area 0
network 10.1.1.0 0.0.0.255
格式:
area area-id
network 网络号 反掩码
反掩码:
0: 精确匹配
1: 任意匹配
Router-id
(2)手工配置:
系统视图下:
router-id 1.1.1.1
配置协议时:
ospf route-id 100.1.1.1
协议 系统视图
reset ospf process ###重置ospf进程
display ospf brief ###查看ospf简要信息
display ospf peer brief ###查看ospf邻居状态
display ospf routing ###只查看ospf路由信息
display ospf interface ###查看有哪些接口被宣告进ospf
(3)下放默认路由
1.配置默认路由
2.ospf视图下,下放默认路由
ospf 1
default-route-advertise
七、链路聚合
(1)配置:
interface Eth-trunk 1 ###创建Eth-trunk 1 接口
trunkport g/0/0/0 to g0/0/3 ###加入成员接口g0/0/0 ~ g0/0/3
display Eth-trunk 1 ###查看Eth-trunk1的接口状态
LACP 链路聚合控制协议
(2)配置:
interface Eth-trunk 1
mode lacp-static ###修改模式为LACP
trunkport g/0/0/0 to g0/0/3
(3)修改 LACP优先级:
LACP priority 0 ###0~65535 ,默认:32768
(4)配置最大活动链路数量:
interface Eth-trunk 1
max active-linknumber 2
(5)修改接口LACP优先级
int g/0/0/1
lacp priority 65535
(6)开始抢占和设置抢占延时
int eth-trunk 1
lacp preempt enable
lacp preempt delay 10
(7)接口初始化
clear configuration int g/0/0/1
int eth-trunk 1
undo portswitch ###关闭二层,开启三层
ip address 10.1.12.2 24
八、VLAN原理和配置
1.链路类型
【a】配置:
display port vlan ###查看接口所在的vlan
diaplay vlan ###查看激活的vlan
【b】创建vlan:
[S1] vlan 10
[S1] vlan batch 10 20
[S1] vlan batch 10 to 20
【c】将接口划入vlan中 + 配置PVID
[S1] interface GigabitEthernet0/0/1
[S1-GigabitEthernet0/0/1] port link-type access ###修改接口类型为access
[S1-GigabitEthernet0/0/1] port default vlan 10
(2)干道链路:trunk,用于交换机之间的互联
配置:
[S1] interface GigabitEthernet0/0/4
[S1-GigabitEthernet0/0/4] port link-type trunk
[S1-GigabitEthernet0/0/4] port trunk allow-pass vlan 10 20
(3)hybrid
在S3上的配置:
交换机与客户端
[S3]interface GigabitEthernet0/0/1
[S3-GigabitEthernet0/0/1]port link-type hybrid
[S3-GigabitEthernet0/0/1] port hybrid pvid vlan 10
[S3-GigabitEthernet0/0/1] port hybrid untagged vlan 10 100
在g0/0/2接口也执行以上操作
交换机与交换机
[S3-GigabitEthernet0/0/3]port hybrid tagged vlan all
在S2也执行S1的操作
效果:
PC6能ping通server,但是不能ping通PC7
九、单臂路由
(1)配置子接口
int g0/0/0.1
ip address 192.168.1.254/24
(2)将SW连接Router的接口配置为trunk
int g0/0/1
port link-type trunk
`trunk allow-pass all
(3)在子接口下配置VLAN-ID终结
int g0/0/0.1
dotlq termination vid 10 ###封装和解封装vlan-id
(4)在子接口下开启ARP识别
int g/0/0/0.1
arp broadcast enable
十、使用三层SW配置VLANIF接口作为网关
1.创建vlan
2.将接口划入vlan
3.创建vlanif接口 + 配置IP 地址
int vlanif 10
ip address 192.168.1.254 24
十一、DHCP的配置
1.全局地址
(1)开启DHCP功能
dhcp enable
(2)创建IP地址池
ip pool huawei
(3)配置网关:
gateway-list 192.168.1.254 192.168.1.253
(4)指定地址池的范围
network 192.168.1.0 mask 255.255.255.0
(5)配置DNS
dns-list 114.114.114.114
(6)保留IP地址
excluded-ip-address 192.168.1.100 192.168.1.200
(7)配置租约
lease day 0 hour 2 minute 0
(8)静态绑定
static-bind ip-address 192.168.1.1 mac-address 5489-98F5-33 36
(9)调用全局地址池
interface GigabitEthernet0/0/0
ip address 192.168.1.254 255.255.255.0
dhcp select global
2.接口地址
interface GigabitEthernet0/0/0
dhcp select interface ###开启接口地址池
dhcp server static-bind ip-address 192.168.2.2 mac-address 5489-9867-4f6e
dhcp server excluded-ip-address 192.168.2.100 192.168.2.200
dhcp server lease day 0 hour 2 minute 0
dhcp server dns-list 8.8.8.8
ipconfig /release ###释放地址
ipconfig /renew ###重新获得地址
单区域ospf配置可以和单臂路由一起配置吗
单区域ospf配置可以和单臂路由一起配置。单臂路由与OSPF实验配置配置要求为绿色区域为运营商网络环境,使能R1、R2、R3运行ospf动态路由协议,R1为核心路由器,R2、R3为汇聚设备。蓝色区域为客户网络,包括客户A的网络和客户B的网络,要求客户A网络通过部署单臂路由实现PC1和PC2的互通。将客户A和客户B网络接入运营商,要求部署静态路由协议,实现A、B的业务互访。
在做一个OSPF的题目,但是实现不了全网都Ping通。
三层交换机的OSPF没有宣告192.168.1.0、2.0和3.0这个网络。导致R0到R2这三台路由器无法学到三个vlan所在的网段,所以路由器没有回到PC的路由。
单臂路由+OSPF怎么配置
你将PC0和PC1的网关都设置为R0连接交换机那个接口子接口的IP地址,你ping不能是不是交换机上没有配置。
下面是我写的配置:
R1配置:
interface Loopback0
ip address 1.1.1.1 255.255.255.255
interface FastEthernet0/0 //连接R0
ip address 192.168.100.1 255.255.255.252
router ospf 1
network 192.168.100.0 0.0.0.3 area 0
network 1.1.1.1 0.0.0.0 area 0
R0配置:
interface FastEthernet0/0 //连接R1
ip address 192.168.100.2 255.255.255.252
interface FastEthernet1/0
no ip address
interface FastEthernet1/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
interface FastEthernet1/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
router ospf 1
network 192.168.100.0 0.0.0.3 area 0
network 192.168.20.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
SW0配置:
vlan 10
vlan 20
interface FastEthernet0/1 //连接路由器R0的fa1/0
switchport mode trunk
interface FastEthernet0/2 //连接PC0
switchport access vlan 10
interface FastEthernet0/3 //连接 PC1
switchport access vlan 20
PC0 ping R1 1.1.1.1
PCping 1.1.1.1
Pinging 1.1.1.1 with 32 bytes of data:
Reply from 1.1.1.1: bytes=32 time=80ms TTL=254
Reply from 1.1.1.1: bytes=32 time=94ms TTL=254
Reply from 1.1.1.1: bytes=32 time=78ms TTL=254
Reply from 1.1.1.1: bytes=32 time=93ms TTL=254
Ping statistics for 1.1.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 78ms, Maximum = 94ms, Average = 86ms
回答完毕,你的采纳是我回答的动力,若还有什么不明白的,可以追问!!!
关于ospf单臂路由链路聚合和pt单臂路由的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。