⊙Red-Giant>? !显示当前模式下所有可执行的命令。 ⊙Red-Giant#co? !显示当前模式下所有以co开头的命令 ⊙Red-Giant#copy ? !显示copy命令后可执行的参数 ⊙Red-Giant#conf ter !交换机命令行支持命令的简写,该命令代表configure terminal ⊙Red-Giant#con(按TAB键自动补齐configure) !交换机支持命令的自动补齐
2、 登陆路由器方式
以Web页面的形式登陆到系统的控制平台,登陆网址是:http://192.168.0.254:8080。选择你所要操作的硬件设备,点击直接进入其操作界面。
在操作过程中使用路由器的操作命令,下面具体介绍。 3、路由器的常用命令
? show 用来显示配置信息(包括:版本、当前配置信息等) ? enable 进入路由器特权模式
? configure 进入路由器全局模式
? interface fastethernet 1/0 进入路由器F1/0的接口模式 ? no shutdown 开启端口
? show ip route 查看路由表信息
? show ip running-config 查看路由器的当前生效信息 4、静态路由配置
? 首先配置路由器端口IP地址
Ra(config)#interface fastethernet 1/0
Ra(config-if)#ip address 192.168.2.1 255.255.255.0 Ra(config-if)#no shutdown Ra(config-if)#exit
Ra(config)#interface fastethernet 1/1
Ra(config-if)#ip address 192.168.3.1 255.255.255.0 Ra(config-if)#no shutdown ? 查看路由器中的路由
当路由器的两个端口配置完IP地址后,会自动生成相应的路由记录,可以通过show ip route命令进行查看。
Ra#show ip route
21
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 * - candidate default Gateway of last resort is no set
C 192.168.2.0/24 is directly connected, FastEthernet 1/0 C 192.168.2.1/32 is local host.
C 192.168.3.0/24 is directly connected, FastEthernet 1/1 C 192.168.3.1/32 is local host. ? 增加一条静态路由
可以用命令ip route为路由器中增加静态路由。
Ra(config)#ip route 202.117.64.0 255.255.255.0 192.168.3.5 Ra(config)#show ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 * - candidate default Gateway of last resort is no set
C 192.168.2.0/24 is directly connected, FastEthernet 1/0 C 192.168.2.1/32 is local host.
C 192.168.3.0/24 is directly connected, FastEthernet 1/1 C 192.168.3.1/32 is local host.
S 202.117.64.0/24 [1/0] via 192.168.3.5 ? 删除一条路由记录
Ra(config)#no ip route 202.117.64.0 255.255.255.0 Ra(config)#show ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 * - candidate default Gateway of last resort is no set
C 192.168.2.0/24 is directly connected, FastEthernet 1/0 C 192.168.2.1/32 is local host.
C 192.168.3.0/24 is directly connected, FastEthernet 1/1 C 192.168.3.1/32 is local host.
Ra(config)#ip route 202.117.64.0 255.255.255.0 192.168.3.7 Ra(config)#show ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 * - candidate default
22
Gateway of last resort is no set
C 192.168.2.0/24 is directly connected, FastEthernet 1/0 C 192.168.2.1/32 is local host.
C 192.168.3.0/24 is directly connected, FastEthernet 1/1 C 192.168.3.1/32 is local host.
S 192.168.5.0/24 is directly connected, FastEthernet 1/0 S 202.117.64.0/24 [1/0] via 192.168.3.7 5、Windows路由命令的使用
Route命令是操作系统中关于路由操作的命令,对网络设置和网络调试非常有用,在Windows 操作系统下的使用格式为:
ROUTE [-f] [-p] [command [destination]
[MASK netmask] [gateway] [METRIC metric]
[IF interface]
其中:-f、-p为选项;command为要执行的路由命令,常用的命令有print(显示路由表)、add(增加一条路由)、delete(删除一条路由记录)和change(修改一条路由记录);destination 表示制定的网络或者主机,在增加、删除和修改路由记录时使用;netmask表示目的网络或者主机的子网掩码,正常的情况下可以不使用,如果使用必须用“MASK”指明;gateway表示欲增加、删除和修改路由地址;metric表示到达目的网络的距离,也就是跳数;interface表示连接的网络接口,在有多个网络接口的时候用来指明所使用的接口。例如:
? 显示主机路由表
? 增加一条路由记录
23
图13-5 增加一条路由记录
? 删除一条路由记录
24
相关推荐: