总结:
Ip不能重复,路由器下每个端口的IP网段都不一样,路由器静态配置时要告诉目的地址和下一条,路由器要相互设置静态才能找到。主机的网关是路由器出来的e口。
1. 进入配置 sysname XXX(RouterA)
2.路由器设置
静态路由对于路由器router A:
配置路由器以太网口IP地址和子网掩码:
[RouterA]interface ethernet0
[RouterA-Ethernet0]ip addrress 10.65.1.2 255.255.0.0
[RouterA-Ethernet0]undo shutdown 激活
配置路由器S端口IP地址和子网掩码:
[RouterA-Ethernet1]int s1 简写
[RouterA-Serial1]ip addrress 10.66.1.1 255.255.0.0
[RouterA-Serial1]undo shutdown
配置路由器S端口速率:
[RouterA-Serial1]clock rate 64000
[RouterA-Serial1]quit
配置路由器静态路由协议:
[RouterA]ip route-static 10.67.0.0 255.255.0.0 10.67.1.1
使能路由:
[RouterA]ip routing
显示路由表的命令为dis ip route.
该命令下能显示各个端口的IP地址和子网掩码,以及是否已经打开
配置完成后要查端口属性命令为:dis curr.
3.交换机配置(未设置表示全通)
交换机VLAN口配置对于SwitchA:
[SwitchA]vlan 2
[SwitchA-vlan2]port e0/1 to e0/4
[SwitchA]dis vlan all
[SwitchA]dis current
[S3026A]interface ethernet0/8
[S3026A-Ethernet0/8]port link-type trunk
[S3026A-Ethernet0/8]port trunk permit vlan all
对于SwitchB:
[SwitchB]vlan 2
[SwitchB-vlan2]port e0/5 to e0/8
[SwitchB]dis vlan all
[SwitchB]dis current
[S3026B]interface ethernet0/1
[S3026B-Ethernet0/1]port link-type trunk
[S3026B-Ethernet0/1]port trunk permit vlan all
[S3026B-Ethernet0/1]quit
[S3026B]dis curr
交换机端口汇聚
交换机端口汇聚聚合操作:
[SwitchA]link-aggregation ethernet0/1 to ethernet0/2 both
[SwitchB]link-aggregation ethernet0/1 to ethernet0/2 both
对于SwitchA:
[Quidway]sysname SwitchA
[SwitchA]interface ethernet0/1
[SwitchA-Ethernet0/1]duplex full
[SwitchA-Ethernet0/1]speed 100
[SwitchA-Ethernet0/1]port link-type trunk
[SwitchA-Ethernet0/1]port trunk permit vlan all
[SwitchA-Ethernet0/1]int e0/2
[SwitchA-Ethernet0/2]duplex full
[SwitchA-Ethernet0/2]speed 100
[SwitchA-Ethernet0/2]port link-type trunk
[SwitchA-Ethernet0/2]port trunk permit vlan all
对于SwitchB:
[Quidway]sysname SwitchB
[SwitchB]interface ethernet0/1
[SwitchB-Ethernet0/1]duplex full
[SwitchB-Ethernet0/1]speed 100
[SwitchB-Ethernet0/1]port link-type trunk
[SwitchB-Ethernet0/1]port trunk permit vlan all
[SwitchB-Ethernet0/1]int e0/2
[SwitchB-Ethernet0/2]duplex full
[SwitchB-Ethernet0/2]speed 100
[SwitchB-Ethernet0/2]port link-type trunk
[SwitchB-Ethernet0/2]port trunk permit vlan all
4.主机设置
双击小电脑:
login:root
password:linux
[root@PCA root]#ifconfig eth0 10.65.1.1 netmask 255.255.0.0
[root@PCA root]#ifconfig
[root@PCA root]#route add default gw 10.65.1.2 此命令为配置网关命令参考
[root@PCA root]#route 此命令为显示所配置的网关
5.设置静态路由(前面是目的地的网段后面是与之相连的下一跳的IP)
配置路由器静态路由协议:
[RouterA]ip route-static 10.67.0.0 255.255.0.0 10.66.1.1(连接着的路由器s口的ip)
使能路由:
[RouterA]ip routing
显示路由表的命令为dis ip route.
IP显示
配置路由器动态路由协议
方法1:
[RouterA]rip
[RouterA-rip]network 10.65.0.0 对网络10.65.0.0进行RIP动态路由协议的设置
方法2:
[RouterA]rip
[RouterA-rip]network all 对与本路由器相连的所有网络进行RIP动态路由协议的设置
使能路由:
[RouterA]ip routing
网友评论