https://www.hao0564.com/3651.html
有时候不方便用WEB页面配置路由器,今天就结合WEB页面和命令行模式如何的配置WAN口静态IP,实现上网功能,详情页面参考H3C官网:https://www.h3c.com/cn/d_202212/1749578_30005_40.htm
路由器概述
[H3C]display version H3C Comware Software, Version 7.1.064, Release 6728P25 Copyright (c) 2004-2022 New H3C Technologies Co., Ltd. All rights reserved. H3C MER8300 uptime is 0 weeks, 0 days, 0 hours, 12 minutes Last reboot reason : Power on Boot image: flash:/mer8300-cmw710-boot-r6728p25.bin Boot image version: 7.1.064P80, Release 6728P25 Compiled Nov 23 2022 15:00:00 System image: flash:/mer8300-cmw710-system-r6728p25.bin System image version: 7.1.064, Release 6728P25 Compiled Nov 23 2022 15:00:00 Feature image(s) list: flash:/mer8300-cmw710-security-r6728p25.bin, version: 7.1.064 Compiled Nov 23 2022 15:00:00 flash:/mer8300-cmw710-voice-r6728p25.bin, version: 7.1.064 Compiled Nov 23 2022 15:00:00 flash:/mer8300-cmw710-data-r6728p25.bin, version: 7.1.064 Compiled Nov 23 2022 15:00:00 CPU ID: 0x11 2G bytes DDR3 SDRAM Memory 8M bytes Flash Memory PCB Version: 2.0 CPLD Version: 1.0 Basic BootWare Version: 1.32 Extended BootWare Version: 1.32 [SLOT 0]CON (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 0]GE0/0 (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 0]GE0/1 (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 0]GE0/2 (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 0]GE0/3 (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 0]SFP0/4 (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 0]SFP0/5 (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 0]CELLULAR0/0 (Hardware)2.0, (Driver)1.0, (CPLD)1.0 [SLOT 2]SIC-4GSW (Hardware)2.0, (Driver)1.0, (CPLD)1.0
Console口配置
在通过Console口搭建本地配置环境时,需要通过超级终端或PuTTY,SecureCRT等终端仿真程序与设备建立连接。用户可以运行这些程序来连接网络设备、Telnet或SSH站点,这些程序的详细介绍和使用方法请参见该程序的使用指导。打开终端仿真程序后,请按如下要求设置终端参数
· 波特率:9600 · 数据位:8 · 停止位:1 · 奇偶校验:无 · 流量控制:无 设备上电,终端上显示设备自检信息,自检结束后提示用户键入回车,出现命令行提示符即可键入命令来配置设备或查看设备运行状态,需要帮助可以随时键入“?”。
Console口安全配置
system line aux 0 authentication-mode password set authentication password simple Zxb@=1234qwer user-role network-admin quit save
路由器命令行下开局配置
开启Telnet 服务
telnet server enable
修改默认用户名密码
[H3C]local-user admin password simple Mj@=1234qwer. authorization-attribute user-role network-admin #web页面会提示输入旧密码设置新密码,老旧都输入Mj@=1234qwer.就OK了
管理接口地址配置
# interface Vlan-interface1 description LAN-interface ip address 192.168.1.1 255.255.254.0 tcp mss 1280 #
命令行下DHCP配置
# dhcp server ip-pool lan1 gateway-list 192.168.1.1 network 192.168.0.0 mask 255.255.254.0 address range 192.168.1.2 192.168.1.254 dns-list 192.168.1.1 #
查看WAN口g0/0口获取地址情况:
查看静态路由表
全局下开启dns proxy enable
# dns proxy enable dns server 10.66.77.1 dns server 10.69.218.192 dns server 114.114.114.114 dns server 202.102.192.68 dns server 202.102.199.68 #
WAN口G0/0下静态IP配置
# interface GigabitEthernet0/0 port link-mode route description Single_Line1 #此条命令会配置显示到web页面上,如下图所示 ip address 192.168.3.66 255.255.255.0 dns server 202.102.192.68 dns server 202.102.199.68 tcp mss 1280 nat outbound #
dhcp上网时外网口配置如下
<H3C>system-view [H3C]interface GigabitEthernet 0/0 [H3C-GigabitEthernet0/0] ip address dhcp-alloc //配置外网口地址为自动获取,当自动获取到地址后会自动生成优先级为70的默认路由 [H3C-GigabitEthernet0/0] nat outbound //开启nat转换
pppoe拨号上网时外网口配置如下
#配置拨号口,拨号的用户名为abc,密码为123456 <H3C>system-view [H3C] dialer-group 1 rule ip permit //设置拨号访问组1,对IP协议报文进行DDR拨号 [H3C] interface dialer 1 //创建拨号口1 [H3C-Dialer1] dialer bundle enable //在接口Dialer1上使能共享DDR [H3C-Dialer1] dialer-group 1 //创建拨号组1 [H3C-Dialer1] ip address ppp-negotiate //ip地址为自动协商 [H3C-Dialer1] dialer timer idle 0 //允许链路空闲时间位0,即永久在线 [H3C-Dialer1] ppp chap user abc //配置拨号的用户名 [H3C-Dialer1] ppp chap password simple 123456 //配置拨号的密码 [H3C-Dialer1] ppp pap local-user abc password simple 123456 //将用户密码和密码一起输入 [H3C-Dialer1] ppp ipcp dns admit-any //设备不发送DNS请求,也能接收对端设备分配的DNS服务器的IP地址。 [H3C-Dialer1] ppp ipcp dns request //配置设备可以主动向对端请求DNS服务器地址 [H3C-Dialer1] nat outbound //开启nat转换 [H3C-Dialer1] quit #将拨号口绑定实际的物理接口 [H3C]interface GigabitEthernet 0/0 [H3C-GigabitEthernet0/0] pppoe-client dial-bundle-number 1
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/4724.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~