路由器的路由配置命令汇总(win和linux系统)
分类: 系统运维
route [-f] [-p] [Command][Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
-f 清除所有网关入口的路由表。如果该参数与某个命令组合使用,路由表将在运行命令前清除。
-p 与 add 命令一起使用时使路由具有永久性。 该参数与 add 命令一起使用时,将使路由在系统引导程序之间持久存在。默认情况下,系统重新启动时不保留路由。与 print 命令一起使用时,显示已注册的持久路由列表。
忽略其他所有总是影响相应持久路由的命令。
Command 指定您想运行的命令 (Add/Change/Delete/Print)。
1.主机路由从一台主机映射一条到本地网络上的的其他主机上
command format:
route add -host destination_ip local_ip -interface interface
eg:
我们想为本地主机接口hme0(204.12.17.1)和另一台在相邻才C类网络上的主机(204.12.16.100)之间增加一条路由
#route add -host 204.12.16.100 204.12.17.1 -interface hme0
增加一个到另一个网络的的直接路由
command format:
route add -net destination_network_ip local_ip -netmask mask
eg:
如果我们要想为C类网掩码在本地主机(204.12.17.1)和我们上面指出的网络之间增加一条路由(204.12.16.0网络)我们可以使用如下的命令:
#route add -net 204.12.16.0 204.12.17.1 -netmask 255.255.255.0
command format:
route add default hostname -interface interface
eg:增加一条到本地路由器(204.54.56.1)的缺省路由,通常用在添加网关并马上生效
#route add default 204.54.56.1 -interface hme1
/? 在命令提示符处显示帮助。
destination 或 gateway 使用的符号名称。如果命令是 print 或 delete,目标和网关
还可以使用通配符,也可以省略网关参数。
示例
若要显示 IP 路由表的全部内容,请键入:
route print
route print 10.*
route add 0.0.0.0 mask 0.0.0.0 192.168.12.1
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3
route delete 10.41.0.0 mask 255.255.0.0
route delete 10.*
route change 10.41.0.0 mask 255.255.0.0 10.27.0.25
1.ifconfig 查看网络接口的信息。普通用户使用ifconfig的全路径:/sbin/ifconfig
ifconfig eth0 hw ether 1234567890ab
ifconfig eht0 up
router>enable
router#
router#config terminal
router(config)#
router(config)#hostname A
A(config)#
A(config)#interface fastethernet 0/0
A(config-if)#
router#show interface serial 0/0
serial 0/0 is up ,line protocol is up
可操作状态………serial 0/0 is up ,line protocol is up
连接问题…………serial 0/0 is up ,line protocol is down
接口问题…………serial 0/0 is down ,line protocol is down
禁用状态…………serial 0/0 is administratively down ,line protocol is down
192.168.1.1
|
192.168.2.2
|
192.168.2.1
|
192.168.3.1
|
192.168.1.10
|
192.168.3.10
|
静态路由的实现
router(config)#hostname A
A(config)#interface f0/0
A(config-if)#ip address ip地址 子网掩码
A(config-if)#no shutdown
B(config)#interface f0/1
B(config-if)#ip address ip地址 子网掩码
B(config-if)#no shutdown
A(config)#ip route 目标网络地址 子网掩码 下一跳地址
B(config)#ip route 目标网络地址 子网掩码 下一跳地址
route(config)#ip route 0.0.0.0 0.0.0.0 下一跳地址
router#show ip route
其中C代表直连的网络,S代表静态的路由,S*代表默认的路由
router (config-line)#login
router (config-line)#password cisco
router (config)#enable password cisco
router (config)#enable secret 1234
router (config)#service password-encryption
router(config)#line console 0
router(config-line)#exec-timeout 0 0 //第一个0代表分钟,第二个0代表秒 此处0 0为永不超时
router(config)#line console 0
router(config-line)#logging synchronous
router(config)#no ip domain-lookup
重启路由器按Ctrl+Break键进入ROM Monitor 模式
rommon 1>confreg 0x2142
rommon 2>reset
重启后选择no
router>enable
router#copy startup-config running-config
router#config terminal
router(config)#enable password cisco
router(config)#config-register 0x2102
router#copy running-config startup-config
router#reloa
路由器的路由配置命令汇总(win和linux系统)的更多相关文章
- CCNA网络工程师学习进程(7)路由器的路由配置
前面一节已经介绍了路由器的端口配置,接着我们介绍路由器的路由配置:静态路由.默认路由和浮动路由的配置:动态路由协议的配置,包括RIP.IGRP.EIGRP和OSPF. (1)路由器的基 ...
- redhat 安装配置samba实现win共享linux主机目录
[转]http://blog.chinaunix.net/uid-26642180-id-3135941.html redhat 安装配置samba实现win共享linux主机目录 2012-03-1 ...
- centos7/rhel7下配置PXE+Kickstart自动安装linux系统
应用场景:临时安装一个系统或者批量安装linux系统,无需人工介入选择下一步,减少在安装系统上的时间浪费,提高工作效率. DHCP + TFTP + Syslinux + FTP + Kickstar ...
- 获取Win和Linux系统启动时间,类似uptime功能,用于判断是否修改过系统时间
目录 前言 测试代码 Win测试 Linux测试 总结 前言 有时候需要判断系统是否有修改过时间,最简单的方法就是获取当前时间A,然后sleep X秒,然后获取 时间B,如果 时间B - 时间A ≠ ...
- 使用SCP命令在多个linux系统间进行copy拷贝,上传,下载...
一,什么是scp scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令.scp命令可以在linux服务器之间复制文件和目录.scp使用ssh安全协议传输数据,具有和ssh一样的验证机制,从 ...
- 使用scp命令在多个Linux系统间进行文件复制
一,什么是scp scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令.scp命令可以在linux服务器之间复制文件和目录.scp使用ssh安全协议传输数据,具有和ssh一样的验证机制,从 ...
- 华为路由器RIP路由协议配置命令
RIP路由协议配置 rip 创建开启协议进程 network + ip 对指定网段接口使能RIP功能IP地址是与路由器直连的网段 debugging rip 1 查看RIP定期更新情况 termina ...
- cisco交换机路由器静态路由配置
一.切换模式 router>en //用户模式enable router#conf t //特权模式 ...
- 华为路由器NAT基本配置命令
NAT地址转换 静态 [R1]int g0/0/0 [R1-GigabitEthernet0/0/0]nat static global 202.169.10.5 inside 172.16.1.1 ...
随机推荐
- EBS R12.2系统logo的修改
https://blog.csdn.net/lzl1101206656/article/details/74171999 EBS系统logo的修改 转载lzl1101206656 发布于2017-07 ...
- RT-Thread--时间管理
时钟节拍 时钟节拍是特定的周期中断,可以看是系统心跳,中断之间的时间间隔取决于不同的应用,一般是 1ms–100ms,时钟节拍率越快,系统的额外开销就越大,从系统启动开始计数的时钟节拍数称为系统时间. ...
- idou老师教你学Istio 29:Envoy启动流程
1. 功能概述 Envoy启动时,会启动一个进程,并在这个进程中启动很多线程,这样,可以启动很多worker线程,一般worker线程数与核心数相同,每个worker线程处理所有已配置的listene ...
- ocr 识别 字体大小问题?
字体大 字体小?????? ???????????
- 【产品对比】Word开发工具Aspose.Words和Spire.Doc性能和优劣对比一览
转:evget.com/article/2018/4/3/27885.html 概述:Microsoft Office Word是微软公司的一个文字处理器应用程序,作为办公软件必不可少的神器之一,Wo ...
- window程序意外关闭自动重启脚本实现
@echo off : tasklist|find /i "xxxx"||start yyyy ping/n 127.1>nul 新建 .bat 文件,将其写入文件 xxxx ...
- 《图解HTTP》笔记2
1.SSL(Secure Socket Layer,安全套接层) 1)SSL的作用 通信加密 确定通信方 SSL 提供认证和加密处理及摘要功能 HTTP 协议中没有加密机制,但可以通过和 SSL(Se ...
- nginx配置跨域之后前后端调用,二次请求
公司项目从前后端不分离转到前后端分离 首先遇到的问题就是前后端分离的时候跨域的问题 但是当跨域成功配置并且能访问成功的时候发现 每次客户端的请求都会发送两次 第一次是OPTIONS的请求,然后才是正常 ...
- linux实操_硬盘
1.硬盘分区 硬盘说明: 查看分区和挂载情况 语法: lsblk -f lsblk 2.增加硬盘 (1)虚拟机添加硬盘 (2)分区 fdisk /dev/sdb (3)格式化 mkfs -text4 ...
- sublimetext插件自定义respository
官方文档(https://packagecontrol.io/docs/submitting_a_package) 上面说明了插件可以按两种方式挂起,一种是github,一种是ssl认证的web服务器 ...