交换机默认网关(实现跨网段telnet)

  交换机的默认网关,是让交换机可以实现跨网段的telnet配置,按照以下拓扑图进行简单的默认网关配置

交换机配置  

  enable   进入特权模式

  conf t     进入全局配置模式

  hostname 修改交换机名

  no ip domain-lookup  去除域名解析

  interface vlan1  进入vlan1

    ip address 192.168.1.1 255.255.255.0  配置vlan1的IP地址(即配置管理地址)

  no shutdown  激活端口

  exit  返回上一级

  ip default-gateway 192.168.1.254  配置默认网关

  exit  返回上一级

  copy running-config startup-config  保存配置

路由器配置

    

  enable   进入特权模式

  conf t     进入全局配置模式

  hostname 修改交换机名

  no ip domain-lookup  去除域名解析

  interface f0/0  进入接口f0/0

  ip address 192.168.0.254 255.255.255.0  配置接口f0/0的ip地址与子网掩码

  no shutdown  激活接口

  exit  返回上一级

  interface f0/1  进入接口f0/1

  ip address 192.168.1.254 255.255.255.0  配置接口f0/1的ip地址与子网掩码

  no shutdown  激活接口

  end  返回到特权模式

  copy running-config startup-config  保存配置

主机配置

  

原文地址:https://www.cnblogs.com/LilacStrawberry/p/9154212.html