星空5G 导航

求路由器接交换机配置的命令?(有图)-

2024-08-26编辑:本站
交换机与路由器的常用配置命令~

1. 交换机支持的命令:
交换机基本状态: switch: ;ROM状态,
路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态

交换机口令设置: switch>enable ;进入特权模式
switch#config terminal ;进入全局配置模式
switch(config)#hostname ;设置交换机的主机名
switch(config)#enable secret xxx ;设置特权加密口令
switch(config)#enable password xxa ;设置特权非密口令
switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4 ;进入虚拟终端
switch(config-line)#login ;允许登录
switch(config-line)#password xx ;设置登录口令
xxswitch#exit ;返回命令



交换机VLAN设置:

switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
switch(config-if)#switchport access vlan 2 ;当前端口加入
vlan 2switch(config-if)#switchport mode trunk ;设置为干线
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan
switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继
switch(config)#vtp domain ;设置发vtp域名
switch(config)#vtp password ;设置发vtp密码
switch(config)#vtp mode server ;设置发vtp模式
switch(config)#vtp mode client ;设置发vtp模式


交换机设置IP地址:

switch(config)#interface vlan 1 ;进入vlan 1
switch(config-if)#ip address ;设置IP地址
switch(config)#ip default-gateway ;设置默认网关
switch#dir flash: ;查看闪存


交换机显示命令:

switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息


2. 路由器支持的命令:
路由器显示命令:

router#show run ;显示配置信息
router#show interface ;显示接口信息
router#show ip route ;显示路由信息
router#show cdp nei ;显示邻居信息
router#reload ;重新起动


路由器口令设置:

router>enable ;进入特权模式
router#config terminal ;进入全局配置模式
router(config)#hostname ;设置交换机的主机名
router(config)#enable secret xxx ;设置特权加密口令
router(config)#enable password xxb ;设置特权非密口令
router(config)#line console 0 ;进入控制台口
router(config-line)#line vty 0 4 ;进入虚拟终端
router(config-line)#login ;要求口令验证
router(config-line)#password xx ;设置登录口令xx
router(config)#(Ctrl+z) ; 返回特权模式
router#exit ;返回命令


路由器配置:

router(config)#int s0/0 ;进入Serail接口
router(config-if)#no shutdown ;激活当前接口
router(config-if)#clock rate 64000 ;设置同步时钟
router(config-if)#ip address ;设置IP地址
router(config-if)#ip address second ;设置第二个IP
router(config-if)#int f0/0.1 ;进入子接口
router(config-subif.1)#ip address ;设置子接口IP
router(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议
router(config)#config-register 0x2142 ;跳过配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引导


路由器文件操作:

router#copy running-config startup-config ;保存配置
router#copy running-config tftp ;保存配置到tftp
router#copy startup-config tftp ;开机配置存到tftp
router#copy tftp flash: ;下传文件到flash
router#copy tftp startup-config;下载配置文件ROM状态:
Ctrl+Break ;进入ROM监控状态
rommon>confreg 0x2142 ;跳过配置文件
rommon>confreg 0x2102 ;恢复配置文件
rommon>reset ;重新引导
rommon>copy xmodem: flash: ;从console传输文件

rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP
rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码
rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP
rommon>TFTP_FILE=c2600.bin ;指定下载的文件
rommon>tftpdnld ;从tftp下载
rommon>dir flash: ;查看闪存内容
rommon>boot ;引导IOS



静态路由:

ip route ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;
静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例


动态路由:

router(config)#ip routing ;启动路由转发
router(config)#router rip ;启动RIP路由协议。
router(config-router)#network ;设置发布路由
router(config-router)#negihbor ;点对点帧中继用。


最好是去官方网站参考手册。


如上图:
ip地址设置如图再次不再写命令waiwang路由器设置如下:
Router#sh runBuilding configuration...
Current configuration : 550 bytes!version 12.4no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Router!spanning-tree mode pvst!!!!interface FastEthernet0/0 no ip address duplex auto speed auto shutdown!interface FastEthernet0/1 ip address 58.251.138.45 255.255.255.0 duplex auto speed auto!interface Vlan1 no ip address shutdown!ip classlessip route 2.2.2.0 255.255.255.0 58.251.138.46
neiwang路由设置
Building configuration...
Current configuration : 656 bytes!version 12.4no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Router!ip dhcp pool 123 network 2.2.2.0 255.255.255.0 default-router 2.2.2.1 dns-server 2.2.2.1!spanning-tree mode pvst!interface FastEthernet0/0 ip address 2.2.2.1 255.255.255.0 duplex auto speed auto!interface FastEthernet0/1 ip address 58.251.138.46 255.255.255.0 duplex auto speed auto!interface Vlan1 no ip address shutdown!ip classlessip route 58.251.138.0 255.255.255.0 58.251.138.45
测试结果

线用错了   黑虚线为交叉线  在这里要用黑实线

配置:(由于没有说明要配置些什么,在这里只说了下很简单的配置)

1.打开路由器int f0/0   在cisco packet tracer软件里有两种方法   第一种用命令

(config)#int f0/0

(config-if)#no shutdown      //shutdown意思为关闭

第二种方法见后面的图片中

2.对路由器int f0/0进行稍微的配置   

Router(config)#int f0/0

Router(config-if)#ip nat inside

Router(config-if)#ip add 192.168.0.254 255.255.255.0  //ip地址

3.对交换机int f0/1进行配置  首先得把int f0/1定义为trunck模式

Switch(config)#int f0/1

Switch(config-if)#switchport mode trunk 

4.设置pc的ip地址(见图)如有疑问  可以继续联系



这样连接可以
但你如果要检测的话 路由的另外一边也要连个交换机
而且两边交换机都要加个PC 来测试网络是否通

命令http://wenku.baidu.com/view/ed6763db6f1aff00bed51e70.html
自己看吧 其实思科的路由就相当于 以前的老计算机使用DOS系统
现在新的路由 都支持WEB操作 相当于 新计算机使用WINDOWS系统

你的图连线有问题
交换机和路由器连接用直通线。应该是实线。你用的虚线是表示交叉线。
再以交换机和路由器的配置命令很多。你必须提出需求才能告诉你怎么配置。

给路由器连接交换机的端口设ip(与交换机一个网段),开启路由即可
命令如下
enable
config //进入全局配置模式
interface fast 0/0 //进入端口
ip address 192.168.1.1 255.255.255.0 // 给端口设置ip
no shutdown //开启端口

这样路由器就设置好了,只要给交换机vlan 设置同网段的ip,即可ping通。 很简单。

  • 交换机与路由器的常用配置命令是什么?
  • 答:1.交换机支持的命令:交换机基本状态:switch:;ROM状态,路由器是rommon>hostname>;用户模式hostname#;特权模式hostname(config)#;全局配置模式hostname(config-if)#;接口状态交换机口令设置:switch>enable;进入特权模式switch#configterminal;进入全局配置模式switch(config)#hostname;设置交换机的主...

  • 路由器交换机的配置命令:详细的来
  • 答:ip route <ip-address> <subnet-mask> <gateway> ;命令格式 router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例 router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例 动态路由:router(config)#ip routing ;启动路由转发 router(co...

  • 分享史上最全华为路由器交换机配置命令大合集
  • 答:   [Quidway]displayvlan[vlan_id];查看VLAN设置    [Quidway]stp{enable|disable};设置生成树,默认关闭    [Quidway]stppriority4096;设置交换机的优先级    [Quidway]stproot{primary|secondary};设置为根或根的备份    [Quidway-Ethernet0/1]stpcost200;设置交换机端口的...

  • 路由器,交换机配置命令大全?
  • 答:华为路由器命令大全 参考资料:http://wenku.baidu.com/view/794aabd049649b6648d747ca.html

  • 【收藏】思科路由器/交换机配置命令大全
  • 答:以下是根据原文章内容整理的HTML格式的命令大全:思科路由器/交换机配置命令大全1. 模式转换:用户模式 → 特权模式: enable 特权模式 → 全局配置模式: ontfg 全局配置模式 → 接口模式: interface 接口类型#接口号 全局配置模式 → 线控模式: line+接口类型+接口号2. 常用配置命令:查看配置: ...

  • 如何将无线路由器连接交换机?
  • 答:1、首先第一步就是主路由器通过WAN端口连接光猫的宽带上网端口 2、接着就是进行交换机的任意端口连接主无线路由器的LAN端口 3、然后急速进行配置方式设备IP地址的配置,然后就是进行配置的IP需要与主路由器(192.168.5.1)一个网段,如下图所示。4、接着就是进行关闭下级路由器,即一层,二层,...

  • 路由器后再接交换机可以吗?具体要怎么设置?
  • 答:可以,路由器后再接交换机,路由器会管理交换机的。但如有手机了,最好接上无线路由器,手机也可上网。1、将入户宽带线与电脑,按下图接好。2、打开浏览器,清空地址栏并输入路由器管理地址192.168.1.1,并在弹出的窗口中设置路由器的登录密码,(密码长度在6-15位区间),该密码用于以后管理路由...

  • dlink交换机配置命令dlink交换机配置
  • 答:d-link交换机配置命令,dlink交换机配置很多人还不知道,现在让我们一起来看看吧!如何将dlink路由器设置为交换机?如果要将路由器作为交换机使用,只需要按照以下步骤进行设置即可。以下示例是将阿迪-624 A连接到有线路由器,并将DI-624 A用作无线交换机。所有用户都从有线路由器获取IP信息。1.首先...

  • 求路由器接交换机配置的命令?(有图)
  • 答:1.打开路由器int f0/0 在cisco packet tracer软件里有两种方法 第一种用命令 (config)#int f0/0 (config-if)#no shutdown //shutdown意思为关闭 第二种方法见后面的图片中 2.对路由器int f0/0进行稍微的配置 Router(config)#int f0/0 Router(config-if)#ip nat inside Router(con...

  • 。问怎样进行三层交换机配置,命令怎样编写。路由器是华为s5720s。_百度...
  • 答:1、首先查看端口配置的命令display this,这个命令要进入端口使用。2、清除端口配置的命令clear configuration this。3、查看VLAN的命令display vlan,可以查看所有vlan的信息。4、批量建立vlan的命令 vlan batch 2 to 8,批量建立2至8的vlan。5、多个端口同时配置的命令,port-group 3 /建立群组3,...

    相关内容

    首页 新知 身健
    返回顶部

    © 星空5G w.xkyn.com