找到
47
篇与
默认
相关的结果
- 第 2 页
-
springboot项目获取来访地址并解析 引入依赖 <dependency> <groupId>org.lionsoul</groupId> <artifactId>ip2region</artifactId> <version>1.7.2</version> </dependency> <!-- 引入fastjson --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>2.0.7</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.12.0</version> </dependency>创建IpUtils 工具类 import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; import org.lionsoul.ip2region.DataBlock; import org.lionsoul.ip2region.DbConfig; import org.lionsoul.ip2region.DbMakerConfigException; import org.lionsoul.ip2region.DbSearcher; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.lang.reflect.Method; import java.net.InetAddress; import java.net.URL; import java.net.URLConnection; import java.net.UnknownHostException; import java.util.Map; import java.util.Objects; public class IpUtils { public static final String UNKNOWN = "未知"; private static final Logger logger = LoggerFactory.getLogger(IpUtils.class); private static final String dbPath; private static DbSearcher searcher; private static DbConfig config; //key 腾讯位置上申请的key 并 将服务器的IP加入白名单 private final static String format_url = "https://apis.map.qq.com/ws/location/v1/ip?ip={}&key=xxxx-xxxx-xxxx-xxxx-xxxx"; private final static String localIp = "127.0.0.1"; static { dbPath = Objects.requireNonNull(IpUtils.class.getResource("/ip2region.db")).getPath(); try { config = new DbConfig(); } catch (DbMakerConfigException e) { e.printStackTrace(); } try { searcher = new DbSearcher(config, dbPath); } catch (FileNotFoundException e) { e.printStackTrace(); } } /** * 获取ip地址 * * @param request * @return */ public static String getIp(HttpServletRequest request) { String ipAddress; try { ipAddress = request.getHeader("x-forwarded-for"); if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("Proxy-Client-IP"); } if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("WL-Proxy-Client-IP"); } if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getRemoteAddr(); if (localIp.equals(ipAddress)) { // 根据网卡取本机配置的IP InetAddress inet = null; try { inet = InetAddress.getLocalHost(); ipAddress = inet.getHostAddress(); } catch (UnknownHostException e) { e.printStackTrace(); } } } // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 if (ipAddress != null && ipAddress.length() > 15) { // = 15 if (ipAddress.indexOf(",") > 0) { ipAddress = ipAddress.substring(0, ipAddress.indexOf(",")); } } } catch (Exception e) { ipAddress = ""; } return "0:0:0:0:0:0:0:1".equals(ipAddress) ? localIp : ipAddress; } /** * 解析ip地址 * * @param ip ip地址 * @return 解析后的ip地址 */ public static String getCityInfo(String ip) { //解析ip地址,获取省市区 String s = analyzeIp(ip); Map map = JSONObject.parseObject(s, Map.class); System.out.println(map); Integer status = (Integer) map.get("status"); String address = UNKNOWN; if (status == 375) { String mess = (String) map.get("message"); System.out.println(mess); address = mess; } if (status == 0) { Map result = (Map) map.get("result"); System.out.println(result); Map addressInfo = (Map) result.get("ad_info"); String nation = (String) addressInfo.get("nation"); String province = (String) addressInfo.get("province"); String city = (String) addressInfo.get("city"); address = nation + "-" + province + "-" + city; } return address; } /** * 根据ip2region解析ip地址 * * @param ip ip地址 * @return 解析后的ip地址 */ public static String getIp2region(String ip) { if (StringUtils.isEmpty(dbPath)) { logger.error("Error: Invalid ip2region.db file"); return null; } if (config == null || searcher == null) { logger.error("Error: DbSearcher or DbConfig is null"); return null; } try { //define the method Method method = null; //B-tree, B树搜索(更快) method = searcher.getClass().getMethod("btreeSearch", String.class); DataBlock dataBlock; dataBlock = (DataBlock) method.invoke(searcher, ip); String ipInfo = dataBlock.getRegion(); if (!StringUtils.isEmpty(ipInfo)) { ipInfo = ipInfo.replace("|0", ""); ipInfo = ipInfo.replace("0|", ""); } return ipInfo; } catch (Exception e) { e.printStackTrace(); } return null; } /** * 根据在腾讯位置服务上申请的key进行请求解析ip * * @param ip ip地址 * @return */ public static String analyzeIp(String ip) { StringBuilder result = new StringBuilder(); BufferedReader in = null; try { String url = format_url.replace("{}", ip); URL realUrl = new URL(url); // 打开和URL之间的链接 URLConnection connection = realUrl.openConnection(); // 设置通用的请求属性 connection.setRequestProperty("accept", "*/*"); connection.setRequestProperty("connection", "Keep-Alive"); connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); // 创建实际的链接 connection.connect(); // 定义 BufferedReader输入流来读取URL的响应 in = new BufferedReader(new InputStreamReader( connection.getInputStream())); String line; while ((line = in.readLine()) != null) { result.append(line); } } catch (Exception e) { logger.error("发送GET请求出现异常!异常信息为:{}", e.getMessage()); } // 使用finally块来关闭输入流 finally { try { if (in != null) { in.close(); } } catch (Exception e2) { e2.printStackTrace(); } } return result.toString(); } }调用 @SpringBootApplication public class OwlAdminApplication{ public static void main(String[] args) { SpringApplication.run(OwlAdminApplication.class, args); HttpServletRequest request = null; String ip = IpUtils.getIp(request); String ipaddress = IpUtils.getCityInfo(ip); System.out.println(ipaddress); } }效果展示 image.png图片
-
壁纸 漫画二次元壁纸: 1.HSQWall(超级英雄):https://hdqwalls.com/ 2.vilipix:https://www.vilipix.com/ 3.pixivic:https://pixivic.com/ 4.pixivel:https://pixivel.moe/ 6.次元小镇:https://dimtown.com/ 6.Anime-pictures:https://anime-pictures.net/ 综合类型壁纸 1.wallpaperHaven:https://wallhaven.cc/ 2.Wall Room(只能通过分辨率筛选):https://wallroom.io/ 3.wallpaperup(侧重于搜索):https://www.wallpaperup.com/ 4.wallpaperscraft(类似于wallpaperhaven):https://wallpaperscraft.com/ 5.10wallpapers:https://www.10wallpaper.com/cn/ 6.极简壁纸:https://bz.zzzmh.cn/index 7.必应壁纸:https://bing.ioliu.cn/ 某一领域壁纸 1.foodiesfeed(食物):https://www.foodiesfeed.com/ 2.故宫壁纸:https://www.dpm.org.cn/lights/royal.html 3.ESO(天文宇宙):https://www.eso.org/public/images/ 4.Simpledesktops(极简风格):http://simpledesktops.com/ 5.天空之城(航拍):https://www.skypixel.com/
-
VMware Workstation17Pro激活码分享 VMware Workstation 17 Pro 激活密钥: JU090-6039P-08409-8J0QH-2YR7F 4A4RR-813DK-M81A9-4U35H-06KND NZ4RR-FTK5H-H81C1-Q30QH-1V2LA 4Y09U-AJK97-089Z0-A3054-83KLA 4C21U-2KK9Q-M8130-4V2QH-CF810 MC60H-DWHD5-H80U9-6V85M-8280D ZA30U-DXF84-4850Q-UMMXZ-W6K8F AC590-2XW97-48EFZ-TZPQE-MYHEA YF39K-DLFE5-H856Z-6NWZE-XQ2XD AC15R-FNZ16-H8DWQ-WFPNV-M28E2 CZ1J8-A0D82-489LZ-ZMZQT-P3KX6 YA11K-6YE8H-H89ZZ-EXM59-Y6AR0
-
H3C路由器外网配置 网络拓扑 image.png图片 基础配置 更改路由器名称 <h3c>system-view [h3c]sysname H3C 配置vlan10以及vlan10下的接口 [H3C]vlan 10 [H3C-vlan10]qu [H3C]interface Vlan-interface 10 [H3C-Vlan-interface10]ip address 192.168.10.1 24 [H3C-Vlan-interface10]qu [H3C]interface GigabitEthernet 2/0 [H3C-GigabitEthernet2/0]port link-mode bridge The configuration of the interface will be restored to the default. Continue? [Y/N]:y [H3C-GigabitEthernet2/0]port link-type access [H3C-GigabitEthernet2/0]port access vlan 10 [H3C-GigabitEthernet2/0]qu [H3C]interface GigabitEthernet 3/0 [H3C-GigabitEthernet3/0]port link-mode bridge The configuration of the interface will be restored to the default. Continue? [Y/N]:y [H3C-GigabitEthernet3/0]port link-type access [H3C-GigabitEthernet3/0]port access vlan 10 [H3C-GigabitEthernet3/0]qu 配置DHCP [H3C]dhcp enable [H3C]dhcp server ip-pool vlan20 [H3C-dhcp-pool-vlan20]network 192.168.20.0 mask 255.255.255.0 [H3C-dhcp-pool-vlan20]gateway-list 192.168.20.1 [H3C-dhcp-pool-vlan20]dns-list 114.114.114.114 [H3C-dhcp-pool-vlan20]expired day 7 [H3C-dhcp-pool-vlan20]address range 192.168.20.20 192.168.20.30 [H3C-dhcp-pool-vlan20]qu [H3C]dns proxy enable [H3C]dhcp server forbidden-ip 192.168.20.25 192.168.20.30 配置vlan20 以及vlan20下的接口 [H3C]vlan 20 [H3C]interface Vlan-interface 20 [H3C-Vlan-interface20]ip address 192.168.20.1 255.255.255.0 [H3C-Vlan-interface20]qu [H3C]interface GigabitEthernet 4/0 [H3C-GigabitEthernet4/0]port link-mode bridge The configuration of the interface will be restored to the default. Continue? [Y/N]:y [H3C-GigabitEthernet4/0]port link-type access [H3C-GigabitEthernet4/0]port access vlan 20 [H3C-GigabitEthernet4/0]qu [H3C]interface GigabitEthernet 5/0 [H3C-GigabitEthernet5/0]port link-mode bridge The configuration of the interface will be restored to the default. Continue? [Y/N]:y [H3C-GigabitEthernet5/0]port link-type access [H3C-GigabitEthernet5/0]port access vlan 20配置外网 [H3C]interface GigabitEthernet 1/0 [H3C-GigabitEthernet1/0]ip address 192.168.241.111 24 //设置外网ip地址 [H3C-GigabitEthernet1/0]qu [H3C]ip route-static 0.0.0.0 0.0.0.0 192.168.241.1 //默认路由器配置 [H3C]ping 202.100.96.68 Ping 202.100.96.68 (202.100.96.68): 56 data bytes, press CTRL_C to break 56 bytes from 202.100.96.68: icmp_seq=0 ttl=52 time=33.305 ms 56 bytes from 202.100.96.68: icmp_seq=1 ttl=52 time=32.455 ms 56 bytes from 202.100.96.68: icmp_seq=2 ttl=52 time=32.240 ms 56 bytes from 202.100.96.68: icmp_seq=3 ttl=52 time=33.281 ms 56 bytes from 202.100.96.68: icmp_seq=4 ttl=52 time=32.272 ms 路由器访问域名就配置 [H3C]dns server 114.114.114.114 [H3C]ping baidu.com Ping baidu.com (39.156.66.10): 56 data bytes, press CTRL_C to break 56 bytes from 39.156.66.10: icmp_seq=0 ttl=48 time=34.576 ms 56 bytes from 39.156.66.10: icmp_seq=1 ttl=48 time=34.424 ms 56 bytes from 39.156.66.10: icmp_seq=2 ttl=48 time=34.379 ms 56 bytes from 39.156.66.10: icmp_seq=3 ttl=48 time=33.744 ms 56 bytes from 39.156.66.10: icmp_seq=4 ttl=48 time=34.336 ms NAT配置 内网用户通过路由器的nat地址池来访问Internet [H3C]nat address-group 1 name ChinaNET //设置nat组 [H3C-address-group-1-ChinaNET]address 192.168.241.111 192.168.241.111 //设置nat地址池 [H3C-address-group-1-ChinaNET]quit [H3C]acl number 2000 name internet [H3C-acl-ipv4-basic-2000]rule 0 permit source 192.168.10.0 0.0.0.255 //nat转换地址段 [H3C-acl-ipv4-basic-2000]rule 1 permit source 192.168.20.0 0.0.0.255 [H3C-acl-ipv4-basic-2000]qu [H3C]interface GigabitEthernet 1/0 [H3C-GigabitEthernet1/0]nat outbound 2000 address-group 1 //在外网接口加上nat转换 环境测试 路由器默认是不开启路径回显的,所以要通过一下命令开启显示。不然Tracert都是* [H3C]ip ttl-expires enable [H3C]ip unreachables enable [H3C]save force //保存配置,最后一定要做一下,不然下次启动之前的配置会丢失。vlan10 内网PC ping和Tracert测试 image.png图片 image.png图片 vlan20 内网PC ping和Tracert测试 地址自动获取 image.png图片 image.png图片 image.png图片
-
锐捷交换机常用命令 基本配置 Enable 进入特权模式 Exit 返回上一级操作模式 End 返回到特权模式 write memory 或copy running-config startup-config 保存配置文件 del flash:config.text 删除配置文件(交换机及1700系列路由器) erase startup-config 删除配置文件(2500系列路由器) del flash:vlan.dat 删除Vlan配置信息(交换机) Configure terminal 进入全局配置模式 (config)# hostname switchA 配置设备名称为switchA (config)#banner motd & 配置每日提示信息 &为终止符 (config)#enable secret level 1 0 star 配置远程登陆密码为star (config)#enable secret level 15 0 star 配置特权密码为star Level 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密 (config)#enable services web-server 开启交换机WEB管理功能 Services 可选以下:web-server(WEB管理)、telnet-server(远程登陆)等 查看信息 show running-config 查看当前生效的配置信息 show interface fastethernet 0/3 查看F0/3端口信息 show interface serial 1/2 查看S1/2端口信息 show interface 查看所有端口信息 show ip interface brief 以简洁方式汇总查看所有端口信息 show ip interface 查看所有端口信息 show version 查看版本信息 show mac-address-table 查看交换机当前MAC地址表信息 show running-config 查看当前生效的配置信息 show vlan 查看所有VLAN信息 show vlan id 10 查看某一VLAN (如VLAN10)的信息 show interface fastethernet 0/1 switchport 查看某一端口模式(如F 0/1) show aggregateport 1 summary 查看聚合端口AG1的信息 show spanning-tree 查看生成树配置信息 show spanning-tree interface fastethernet 0/1 查看该端口的生成树状态 show port-security 查看交换机的端口安全配置信息 show port-security address 查看地址安全绑定配置信息 show ip access-lists listname 查看名为listname的列表的配置信息 show access-lists 端口的基本配置 (config)#Interface fastethernet 0/3 进入F0/3的端口配置模式 (config)#interface range fa 0/1-2,0/5,0/7-9 进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式 (config-if)#speed 10 配置端口速率为10M,可选10,100,auto (config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应) (config-if)#no shutdown 开启该端口 (config-if)#switchport access vlan 10 将该端口划入VLAN10中,用于VLAN (config-if)#switchport mode trunk 将该端口设为trunk模式,用于Tag vlan,可选模式为access , trunk (config-if)#port-group 1 将该端口划入聚合端口AG1中,用于聚合端口 聚合端口的创建 (config)# interface aggregateport 1 创建聚合接口AG1 (config-if)# switchport mode trunk 配置并保证AG1为 trunk 模式 (config)#int f0/23-24 (config-if-range)#port-group 1 将端口(端口组)划入聚合端口AG1中 生成树 (config)#spanning-tree 开启生成树协议 (config)#spanning-tree mode stp 指定生成树类型为stp,可选模式stp , rstp , mstp (config)#spanning-tree priority 4096 设置交换机的优先级为4096 , 优先级值小为高。优先级可选值为0,4096,8192,……,为4096的倍数。交换机默认值为32768 VLAN的基本配置 (config)#vlan 10 创建VLAN10 (config-vlan)#name vlanname 命名VLAN为vlanname (config-if)#switchport access vlan 10 将该端口划入VLAN10中 某端口的接口配置模式下进行 (config)#interface vlan 10 进入VLAN 10的虚拟端口配置模式 (config-if)# ip address 192.168.1.1 255.255.255.0 为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录的IP地址 (config-if)# no shutdown 启用该端口 端口安全 (config)# interface fastethernet 0/1 进入一个端口 (config-if)# switchport port-security 开启该端口的安全功能 1.配置最大连接数限制 (config-if)# switchport port-secruity maxmum 1 配置端口的最大连接数为1,最大连接数为128 (config-if)# switchport port-secruity violation shutdown 配置安全违例的处理方式为shutdown,可选为protect (当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisable recovery来恢复) 2.IP和MAC地址绑定 (config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1 接口配置模式下配置MAC地址xxxx.xxxx.xxxx和IP172.16.1.1进行绑定(MAC地址注意用小写) 三层路由功能(针对三层交换机) (config)# ip routing 开启三层交换机的路由功能 (config)# interface fastethernet 0/1 (config-if)# no switchport 开启端口的三层路由功能(这样就可以为某一端口配置IP) (config-if)# ip address 192.168.1.1 255.255.255.0 (config-if)# no shutdown 三层交换机路由协议 (config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由 注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码 172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口) (config)# router rip 开启RIP协议进程 (config-router)# network 172.16.1.0 申明本设备的直连网段信息 (config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2) (config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持) (config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID) (config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID) (config-router)# network 192.168.1.0 0.0.0.255 area 0 申明直连网段信息,并分配区域号(area0为骨干区域) IP ACL: 交换机采用命名的访问控制列表;分标准(stand)和扩展(extended)两种 1.标准ACL (config)#ip access-list stand listname 定义命名标准列表,命名为listname,stand为标准列表 (config-std-nacl)#deny 192.168.30.0 0.0.0.255 拒绝来自192.168.30.0网段的IP流量通过 注:deny:拒绝通过;可选:deny(拒绝通过)、permit(允许通过) 192.168.30.0 0.0.0.255:源地址及源地址通配符;可使用any表示任何IP (config-std-nacl)#permit any (config-std-nacl)#end 返回 2.扩展ACL (config)#ip access-list extended listname 定义命名扩展列表,命名为listname,extended为扩展 (config-ext-nacl)#deny tcp 192.168.30.0 0.0.0.255 192.168.10.0 0.0.0.255 eq www 拒绝源地址为192.168.30.0网段的IP访问目的地址为192.168.10.0网段的WWW服务 注:deny:拒绝通过,可选:deny(拒绝通过)、permit(允许通过) tcp: 协议名称,协议可以是udp, ip,eigrp, gre, icmp, igmp, igrp等等。 192.168.10.0 0.0.0.255:源地址及源地址通配符 192.168.30.0 0.0.0.255:目的地址及目的地址通配符 eq:操作符(lt-小于,eq-等于,gt-大于,neg-不等于,range-包含) www:端口号,可使用名称或具体编号 可以使用的协议名称(或编号)和端口名称(或编号)请打?查询。 (config-ext-nacl)#permit ip any any 允许其它通过 (config-ext-nacl)#end 返回 (config)#interface vlan 10 进入端口配置模式 (config-if)# ip access-group listname in 访问控制列表在端口下in方向应用;可选:in(入栈)、out(出栈) (config-if)#end 返回 注:配置ACL时,若只想对其中部分IP进行限制访问时,必须配置允许其流量通过,否则设备只会对限制IP进行处理,不会对
-
华为交换机常用命令 华为交换机常用命令 视图分类 用户视图 登陆设备后,直接进入用户模式,只能执行少量查看配置的命令 Info: The max number of VTY users is 10, and the number of current VTY users on line is 1. The current login time is 2020-04-10 12:15:00+00:00. <huaweis5720>系统视图 用户模式下,输入system-view命令进入视图模式,可执行设备全局配置的命令 <hauweis5720>system-view Enter system view, return user view with Ctrl+Z. [huaweis5720]局部视图 系统视图模式下,输入局部配置命令,进入局部对像的配置视图。如interface GE 1/0/0,进入GE1/0/0端口配置模式 <huaweis5720>system-view Enter system view, return user view with Ctrl+Z. [huaweis5720]interface GigabitEthernet 1/0/1 [huaweis5720-GigabitEthernet1/0/1]常用命令 命令简介 命令 缩写 解释 display dis 查看相应对象信息 undo 撤消或反向操作对应命令 system-view sy 进入系统视图 sysname 设置交换机名称 quit q 退出当前视图 reboot 交换机重启 reset restart 重新启动当前接口 shutdown 关闭当前接口 信息查看命令 交换机信息查看 display version 查看交换机软件版本 display clock 查看交换机时钟 交换机配置查看 display saved-configuration 显示系统保存配置 display current-configuration 显示系统当前配置 当前对象信息查看 display this 显示当前信息。 display this include-default 显示当前接口视图下的接口信息,包括默认值。 display this interface 显示当前接口视图下的接口信息。 查看接口 display interface 查看接口当前运行状态和接口统计信息 display interface brief 查看接口状态和配置的简要信息。 display interface description 查看指定接口的描述信息 display interface vlanif 查看VLANIF接口的状态信息、配置信息和统计信息。 查看IP相关 display ip interface 查看接口与IP相关的配置和统计信息,包括接口接收和发送的报文数、字节数和组播报文数,以及接口接收、发送、转发和丢弃的广播报文数。 display ip interface brief 看接口与IP相关的简要信息,包括IP地址、子网掩码、物理链路和协议的Up/Down状态以及处于不同状态的接口数目。 display ip interface description 查看接口与IP相关的简要信息,包括IP地址、子网掩码、物理层状态、链路层协议状态,及接口描述信息和处于不同状态的接口数目。 display ip pool 显示所有ip pool display ip pool name {pool name} {all|conflict|expired|used} 显示ip pool详细信息 display ip host 查看静态DNS表项 display ip socket 查看已创建的IPv4 Socket信息。 display ip statistics 显示IP流量统计信息。 查看路由 display ip routing-table 显示路由信息 display ospf peer 查看ospf邻接等信息 display ospf peer brief 查看ospf邻接等简要信息 display rip 查看rip路由信息 网络及流量 display network status { all|tcp|udp|port port-number } 显示IP流量统计信息 display tcp statistics 查看TCP流量统计信息 display udp statistics 查看UDP流量统计信息 VLAN查看 display vlan 显示VLAN信息 display vlan {pvid} verbose 查看vlan的详细信息 display port vlan 查看VLAN中包含的接口信息 display sub-vlan 查看Sub-VLAN类型的VLAN表项信息 display super-vlan 查看Super-VLAN类型的VLAN表项信息 display mac-vlan mac-address all 查看所有MAC地址划分VLAN的配置信息 display mac-vlan vlan 2 查看vlan 2 MAC地址划分VLAN的配置信息 查看ACL配置 display acl {all | name | ipv6} 查看ACL display traffic classifier user-defined 查看用户定义的流分类 display traffic behavior user-defined 查看用户定义的流行为 display traffic policy user-defined {policy name} 查看用户定义的流策略 display traffic-applied {inbound | outbound | interface | vlan} 查看流策略应用情况 display traffic policy {global | interface | statistics | vlan } {inbound | outbound} 查看更多流策略信息 display traffic policy statistics {global | interface | vlan} {inbound | outbound} 查看流策略统计信息 display traffic-filter applied-record 查看acl应用的接口 查看NAT配置 路由器命令 display nat static {acl | global | inside | interface} 查看静态NAT信息 display nat session {all | dest | number | protocol | source} 查看动态NAT信息 display nat server {acl | global | inside | interface} 查看NAT server信息 配置管理命令 端口管理 port 配置接口的缺省VLAN并加入该VLAN port description 配置接口的描述信息,描述与接口相连的设备类型。 port gigabitethernet 0/0/1 to 0/0/4 port default vlan 配置接口的缺省VLAN并同时加入这个VLAN。 port link-type {access | hybird | trunk} 配置接口的链路类型 port trunk allow-pass vlan {vlanid} 将trunk接口加入vlan 端口配置 speed {10|100|auto} 配置端口工作速率 duplex {half|full|auto} 配置端口工作状态 端口组操作 display port-group {all} 查看端口组 port-group {id} 创建端口组 group-member gigabitethernet 0/0/2 to gigabitethernet 0/0/10 将2到10端口加入端口组 VLAN管理 vlan {id} 创建VLAN并进入VLAN视图,如果VLAN已存在,直接进入该VLAN的视图。 vlan batch 10 to 20 批量创建VLAN vlan range 10 to 20 创建临时VLAN组,并进入VLAN-Range视图 vlan statistics 配置VLAN的流量统计模式,即配置按包或按字节进行VLAN流量统计。 vlan statistics interval 配置VLAN的流量统计的时间间隔 ip address 用来配置接口的IP地址。 接口管理 interface gigabitethernet 0/0/1 进入指定的接口或子接口视图,进入0/0/1的接口 DNS管理 查看 display dns dynamic-host 查看动态DNS表项 display dns domain 查看域名后缀的相关信息 display dns server 查看DNS服务器的相关信息 设置 dns domain domain-name 命令用来配置域名后缀,如 dns domain com.cn。 dns resolve 命令用来使能动态域名解析功能 dns server {ip} 命令用来配置DNS服务器的IP地址 ip host {domain} {ip} 命令用来配置静态DNS表项 ip host www.huawei.com 10.10.10.4。 DHCP管理 dhcp enable 命令用来开启DHCP功能。 dhcp select global 从全局配置中获取dhcp配置 ACL管理 acl {name | number | ipv6} 创建acl rule [{ruleid}] permit ip source {源ip} {反掩码} [ destination {源ip} {反掩码} ] 创建允许规则 rule [{ruleid}] deny ip source {源ip} {反掩码} [ destination {源ip} {反掩码} ] 创建拒绝规则 traffic-filter {inbound | outbound} acl {acl number} 在接口上应用acl规则 创建流分类 traffic classifier {classifier name} operator { and |or } if-match acl {acl number} 为流分类设置匹配规则 创建流行为 traffic behavior {behavior name} permit | deny | redirect 为流行为配置动作 创建流策略 traffic policy {policy name} classifier {classifier name} behavior {behavior name} 关联流分类与流行为 将流策略应用到接口 interface g0/0/1 traffic-policy {policy name} {inbound | outbound} 接口绑定流策略 NAT管理 边界路由器接口上配置静态NAT nat static global {外部ip} inside {内部ip} 添加静态nat,内外部ip一对一 动态NAT,使用dis nat session查看 nat address-group {groupid} {ip开始} {ip结束} 添加外部可用地址池 nat outbound {acl id} address-group {address-group id} no-pat 添加动态地址转换 NAPT,使用dis nat session查看 nat outbound {acl id} [address-group {address-group id}] 添加动态端口地址转换 NAT server,使用dis nat server查看 nat server protocol tcp global {外部ip} {外部端口} inside {内部ip} {内部端口} 添加nat server转换 用户管理 查看本地用户 display local-user 查看用户接口 display user-interface 设置用户vty0为4个并发 user-interface vty 0 4 进入用户console0接口 user-interface console 0 用户管理 local-user {username} password cipher {password} local-user {username} level 15 local-user {username} service-type telnet terminal ssh 绑定IP与MAC user-bind ip-address 10.0.0.2 mac-address 0001-0203-0405 user privilege level 3 LEVEL 0(访问级):可以执行用于网络诊断等功能的命令。包括ping、tracert、telnet等命令,执行该级别命令的结果不能被保存到配置文件中。 LEVEL 1(监控级):可以执行用于系统维护、业务故障诊断等功能的命令。包括debugging、terminal等命令,执行该级别命令的结果不能被保存到配置文件中。 LEVEL 2(系统级):可以执行用于业务配置的命令,主要包括路由等网络层次的命令,用于向用户提供网络服务。 LEVEL 3(管理级):最高级,可以运行所有命令:关系到系统的基本运行、系统支撑模块功能的命令,这些命令对业务提供支撑作用。包括文件系统、FTP、TFTP、XModem下载、用户管理命令、级别设置命令等。 日志与统计 打开统计 display counters 查看接口的流量统计计数 statistic enable trace mac enable trace mac aa99-6600-5600 vlan 2 其它命令 display stp 显示生成树信息 display mac-address 显示MAC地址表 display bridge mac-address 查看当前桥接设备mac地址 display arp 显示ARP信息表 display voice-vlan oui 查看Voice VLAN的OUI及其相关属性。 display voice-vlan status 查看当前Voice VLAN的相关信息 mac-vlan mac-address 操作实战 VLAN操作 创建vlan,设置vlan的ip,并将端口加入vlan中。 进入全局配置视图 system-view 新建vlan2 [Huawei] vlan 2 进入vlan2的接口视图 [Huawei] interface vlan 2 设置vlan2的三层网关路由 [Huawei-Vlanif2] ip address 10.0.0.1 255.255.255.0 进入0/0/1接口,配置为access接口并加入vlan2中 [Huawei] interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1] port link-type access [Huawei-GigabitEthernet0/0/1] port default vlan 2 进入0/0/2接口,配置为trunk接口并加入vlan2中 [Huawei] interface GigabitEthernet 0/0/2 [Huawei-GigabitEthernet0/0/2] port link-type trunk [Huawei-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 查看端口配置的信息 [Huawei-GigabitEthernet0/0/2] dis this 进入vlan2,将0/0/2到0/0/5端口加入到vlan2中(port link-type需要是access类型) [Huawei] vlan 2 [Huawei-vlan2] port GigabitEthernet 0/0/2 to 0/0/5 端口组操作 需要对多个端口进行相同操作时,可以创建端口组进行批量操作。 创建端口组1,进行批量端口操作 [Huawei] port-group 1 将6到10端口加入端口组 [Huawei-port-group-1] group-member gigabitethernet 0/0/6 to gigabitethernet 0/0/10 批量将2~10端口修改为access模式 [Huawei-port-group-1] port link-type access 批量将6~10端口加入到vlan 2中 [Huawei-port-group-1] port default vlan 2 IP POOL操作 system-view 进入ip pool中 [Huawei] ip pool vlan10 在ip pool中添加dns server [Huawei-ip-pool-vlan10] dns-list 8.8.8.8 设置网关 [Huawei-ip-pool-vlan10] gateway-list 10.0.0.1 设置ip pool的ip段和池,需要与vlanif接口配置匹配,否则ip分配不了 [Huawei-ip-pool-vlan10] network 10.0.0.0 mask 255.255.255.0 过期时间 [Huawei-ip-pool-vlan10] lease day 10 DHCP操作 system-view 全局打开DHCP服务 [Huawei] dhcp enable 进入vlan的接口视图 [Huawei] interface vlanif 2 设置vlan2的三层网关路由 [Huawei-Vlanif2] ip address 10.0.0.1 255.255.255.0 从全局配置中获取dhcp配置 [Huawei-Vlanif2] dhcp select global 静态添加路由 system-view display ip routing-table ip route-static 目的ip 目标地址掩码 下一跳ip [Huawei] ip route-static 10.0.1.0 255.255.255.0 10.0.0.1 删除路由 [Huawei] undo ip route-static 10.0.1.0 255.255.255.0 10.0.0.1 RIP路由管理 system-view 修改loopback0地址 [Huawei] int LoopBack 0 [Huawei-LoopBack0] ip address 1.1.1.1 0 创建rip进程 [Huawei] rip 1 启动版本2 [Huawei-rip-1] version 2 宣告网段 [Huawei] network 10.0.0.0 [Huawei] network 1.0.0.0 OSPF路由管理 system-view 创建ospf [Huawei] ospf 1 router-id 1.1.1.1 创建area0区域 [Huawei-ospf-1] area 0 加入192.168.0.0/24子网 [Huawei-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255 [Huawei-ospf-1-area-0.0.0.0]dis this area 0.0.0.0 network 192.168.0.0 0.0.0.255 [Huawei-ospf-1-area-0.0.0.0] ACL管理 system-view 配置acl [Huawei] acl 3000 [Huawei-acl-adv-3000] rule permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255 [Huawei-acl-adv-3000] rule permit ip source 192.168.2.0 0.0.0.255 [Huawei-acl-adv-3000] quit 配置流分类,匹配acl [Huawei] traffic classifier c0 operator or [Huawei-classifier-c0] if-match acl 3000 [Huawei-classifier-c0] quit 配置流行为,设置动作 [Huawei-behavior-b0] traffic behavior b0 [Huawei-behavior-b0] permit [Huawei-behavior-b0] quit 配置流策略,关联流分类c0与流行为b0 [Huawei] traffic policy p0 [Huawei-trafficpolicy-p1] classifier c0 behavior b0 [Huawei-trafficpolicy-p1] quit 配置流策略应用到接口 [Huawei] interface g0/0/1 [Huawei-GigabitEthernet0/0/1] traffic-policy p0 inbound [Huawei-GigabitEthernet0/0/1] return 用户管理 查看本地用户 display local-user system-view 进入aaa配置模式 [Huawei] aaa 配置本地用户账号密码 [Huawei-aaa] loca-user user1 password cipher 123456 用户服务类型为telnet,使用telnet登陆 [Huawei-aaa] local-user user1 service-type telnet 配置用户特权等级15 [Huawei-aaa] local-user user1 privilege level 15
-
VMware vSphere(ESXI)6.7 登录提示密码错误(实际上密码无误)的解决方法 1、问题 近期频繁使用ESXI来装系统但是登录WEB控制台时明明账号密码都正确但还是提示账号密码错误 经查官方文档发现这是ESXI6.7的致命BUG后期版本已修复,废话不多说解决办法如下 ldtxsnoh.png图片 2、准备工具 显示器键盘接实体服务器或者BMC远程控制台(不要问为什么 问就是拿显示器和键盘砸了服务器,换台新的) 华丽的跑马灯 3、解决办法 3.1连接显示器和登录BMC控制台会看到此界面按F2输入密码 ldtxxv48.png图片 3.2选择Troubleshooting Options 狠狠敲下回车 ldtxzot4.png图片 3.3选Restart Managentment Agents回车 ldty14bc.png图片 3.4按F11 --ok ldty20bt.png图片 3.5耐心等待 莫激动 莫慌 ldty2lip.png图片 3.6 狠击回车键 ldty3jyb.png图片 3.7返回web控制台登录--ok 如果还提示密码错误请挂载脑盘查阅密码是否正确或查阅以下链接 VMware vSphere(ESXI)6.7 忘记root密码的解决方法 ldty79cb.png图片
-
CentOS系统配置远程桌面 配置远程桌面 安装xdrp windows登录需要安装xdrp,需要先配置epel源之后方可安装xdrp yum install -y epel-release yum install -y xrdp设置开机自启 systemctl start xrdp systemctl enable xrdp开放3389端口 firewall-cmd --zone=public --add-port=3389/tcp --permanent # 开放3389端口 firewall-cmd --reloadxrdp默认使用3389端口,查看此时端口使用情况 [root@localhost ~]# lsof -i:3389 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME xrdp 2793 root 11u IPv6 36288 0t0 TCP *:ms-wbt-server (LISTEN)远程连接方式 此时直接使用windows远程桌面连接即可