标签:结构 并且 网关 标准 通信 串行 vlan 针对 network
1.所需设备int f0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
router OSPF 1
进入 OSPF协议模式,进程 号为1
network 192.168.2.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 1
声明本路由由器所知的网段,即路由器活动接口所在的网段
access-list 10 permit 192.168.3.127 0.0.0.127
设置标准访问控制列表,允许指定的网段
access-list 10 deny 192.168.3.128 0.0.0.127
拒绝指定的网段
interface fa 0
ip access-group 1 out
在接口模式下应用访问控制列表
username ruijie password 123
在路由器上建立 一个用户,并设置密码
interface seri 0
encapsulation ppp
ppp authentication pap
设置串行链路的认证模式为ppp+chap
R2的配置
configure terminal
interface fa 0
ip address 192.168.3.2 255.255.255.0
no shutdown
exit
interface Ser 0
ip address 192.168.2.1 255.255.255.0
clork rate 5600
no shutdown
exit
router ospf 1
network 192.168.2.0 0.0.0.255 area 0
exit
router rip
version 2
network 192.168.3.0
exit
router ospf 1
redistribute rip metric-type 1 metric 10 subnets
exit
router rip
redistribute ospf 1 metric 3
exit
inter ser 0
ppp pap sent-username ruijie password 123
exit
R3的配置
configure terminal
interface fa 0
ip address 192.168.4.2 255.255.255.0
no shutdown
exit
interface fa 1
ip address 192.168.5.2 255.255.255.0
no shutdown
exit
interface fa 2
ip address 192.168.3.1 255.255.255.0
no shutdown
exit
router rip
version 2
network 192.168.5.0
network 192.168.3.0
network 192.168.4.0
interface fastethernet 2
ip nat outside
exit
interface fastethernet 0
ip nat inside
exit
interface fastethernet 1
ip nat inside
exit
access-list 10 permit 192.168.10.0 0.0.0.255
ip nat pool abc 192.168.3.5 192.168.3.127 netmask 255.255.255.0
ip nat inside source list 10 pool abc overload
access-list 20 permit 192.168.20.0 0.0.0.255
ip nat pool cba 192.168.3.129 192.168.3.253 netmask 255.255.255.0
ip nat inside source list 20 pool cba overload
S1的配置
vlan 10
建立VLAN
exit
vlan 20
exit
inter range fa 0/1-2
switchport mode trunk
exit
设置指定的端口为trunk模式
inter range fa 0/1-2
port-group 1
exit
将端口加入到1号聚合组
inter range fa 0/3-4
switchport mode trunk
exit
spanning-tree
spanning-tree mode mstp
声明生成树协议模式为 MST
spanning-tree mst configuration
进入mst配置模式
name taishan
生成树名称和更新版本
revision 1
instance 1 vlan 10
instance 2 vlan 20
建立实例1和2,关联相关的VLAN
exit
spanning-tree mst 1 priority 8192
设置相应的实例的优先级,优先级值越小级别越高
inter fa 0/5
no switchport
将接口转换为路由模式
ip address 192.168.4.1 255.255.255.0
no shut
exit
inter vlan 10
进入vlan10的虚拟接口
ip address 192.168.10.1 255.255.255.0
standby 1 priority 120
设置vrrp的优先级 ,值越小级别越高,级别高的会成为主要转发的路由器
standby 1 ip 192.168.10.254
设置vrrp1的虚拟ip地址
exit
inter vlan 20
ip address 192.168.20.1 255.255.255.0
standby 2 ip 192.168.20.254
ip router rip
version 2
network 192.168.10.0
network 192.168.20.0
network 192.168.4.0
S2的配置
vlan 10
exit
vlan 20
exit
inter range fa 0/1-2
switchport mode trunk
exit
inter range fa 0/1-2
port-group 1
exit
inter range fa 0/3-4
switchport mode trunk
exit
以下设置MST,优先级与别外一台路由器相反,以达到互为主备的目的
spanning-tree
spanning-tree mode mstp
spanning-tree mst configuration
name taishan
revision 1
instance 1 vlan 10
instance 2 vlan 20
exit
spanning-tree mst 2 priority 8192
inter fa 0/5
no switchport
ip address 192.168.5.1 255.255.255.0
no shut
Exit
以下为设置VRRP,与上一台设置的优先级不同,形成互为主备的虚拟网关
inter vlan 10
ip address 192.168.10.1 255.255.255.0
standby 1 ip 192.168.10.254
exit
inter vlan 20
ip address 192.168.20.1 255.255.255.0
standby 2 priority 120
standby 2 ip 192.168.20.254
ip router rip
version 2
network 192.168.10.0
network 192.168.20.0
network 192.168.5.0
S3的配置
vlan 10
exit
vlan 20
exit
inter range fa 0/1-2
switchport mode trunk
exit
spanning-tree
spanning-tree mode mstp
spanning-tree mst configuration
name taishan
revision 1
instance 1 vlan 10
instance 2 vlan 20
exit
inter fa 0/5
switchport access vlan 10
exit
inter vlan 10
ip address 192.168.10.1 255.255.255.0
exit
inter vlan 20
ip address 192.168.20.1 255.255.255.0
S4的配置
vlan 10
exit
vlan 20
exit
inter range fa 0/1-2
switchport mode trunk
exit
spanning-tree
spanning-tree mode mstp
spanning-tree mst configuration
name taishan
revision 1
instance 1 vlan 10
instance 2 vlan 20
exit
inter fa 0/5
switchport access vlan 20
exit
inter vlan 10
ip address 192.168.10.1 255.255.255.0
exit
inter vlan 20
ip address 192.168.20.1 255.255.255.0
标签:结构 并且 网关 标准 通信 串行 vlan 针对 network
原文地址:https://blog.51cto.com/793906/2391131