MIUI查看电量的方法

MIUI查看电量的方法
注:转自小米社区
最新查看电池健康度方法
1.在拨号盘输入*#*#284#*#*抓取log。
2.抓取完成后,请解压缩包(bugreport-tucana-QKQ1),解压完成后打开文件夹里面还有一个压缩包在进行解压。
3.解压完成后,打开与上一个压缩包同名的TXT
4.打开后搜索关键词healthd,搜索到后里面有一个fc的值,就是你的学习后的电量。
5.针对充电慢的问题,可以在该TXT搜索关键词thermal level就可以了,上面是在healthd一行中找不到tl就找上面的这个词,
注意事项:fc是学习后的电池容量,可做为真实电池容量计算健康度,健康度计算公式:学习后电量除以手机原来的容量等于健康度,tl为0时,充电速度是正常的,如果超过0就说明充电速度被限制了,那么请用户不要边冲边玩和亮屏充电,当然环境造成的发热是无法抵御的,总之一句话只要不发热随便你怎么玩,亮屏充电也没问题。

网盘搭建,云网盘,Centos8.3部署 seafile 8.0.2教程

虚拟机安装系统系统:Centos 8.3 http://mirrors.aliyun.com/centos/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-dvd1.iso

准备工作:

1、安装 MariaDB
[root@seahub ~]##使用yum安装Mariadb
[root@seahub ~]# yum install -y mariadb mariadb-server
配置MariaDB
[root@snipeit ~]##初始化数据库
[root@snipeit ~]# service mariadb start
Redirecting to /bin/systemctl start mariadb.service
[root@snipeit ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): #直接回车
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y #是否设置密码,当然是
New password: PassW0rd #数据库管理密码
Re-enter new password: PassW0rd #确认密码
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
… Success!
Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
… Success!
By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y

  • Dropping test database…
    … Success!
  • Removing privileges on test database…
    … Success!
    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.
    Reload privilege tables now? [Y/n] y
    … Success!
    Cleaning up…
    All done! If you’ve completed all of the above steps, your MariaDB
    installation should now be secure.

Thanks for using MariaDB!
[root@snipeit ~]##登陆数据库,登陆成功则表示安装完成
[root@snipeit ~]# mysql -u root -p
Enter password:
MariaDB [(none)]> exit
Bye

2、安装依赖环境
yum install tree -y #这个是结构目录
yum install wget –y #组件
yum install vim –y #组件
yum -y install gcc gcc-c++ #必装
yum install python3-devel -y #必装
yum install mariadb-devel -y #必装
yum install python3 python3-setuptools python3-pip python3-ldap -y #必装
pip3 install Pillow pylibmc captcha jinja2 sqlalchemy #必装,一项一项来
pip3 install django-pylibmc django-simple-captcha #必装,一项一项来
pip3 install psd-tools #必装,一项一项来
pip3 install ConfigParser #必装,一项一项来
pip3 install future #必装,一项一项来
pip3 install mysqlclient #必装,一项一项来

上面的环境安装可能会有多次失败(网络原因),请多次尝试,一项一项过,必须保证所有的组件安装成功

3、 环境部署完成后,有条件的做个整机备份(快照)

[root@seahub ~]# cd /opt/ #进入opt目录
[root@seahub ~]# ls
[root@seahub ~]# mkdir seafile #创建安装目录
[root@seahub ~]# wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_8.0.2_x86-64.tar.gz #下载seafile安装包
[root@seahub ~]# ls
seafile seafile-server_8.0.2_x86-64.tar.gz
[root@seahub ~]# cp seafile-server_8.0.2_x86-64.tar.gz seafile #复制一份
[root@seahub ~]# ls
seafile seafile-server_8.0.2_x86-64.tar.gz
[root@seahub ~]# cd seafile/
[root@seahub ~]# ls
seafile-server_8.0.2_x86-64.tar.gz
[root@seahub ~]# tar -xzf seafile-server_8.0.2_x86-64.tar.gz #解压安装包
[root@seahub ~]# ls
seafile-server-8.0.2 seafile-server_8.0.2_x86-64.tar.gz
[root@seahub ~]# mkdir installd
[root@seahub ~]# mv seafile-server_8.0.2_x86-64.tar.gz installd/ #将压缩包归档,本人强迫症,不需要的略过…

4、安装包下载完成,目录结构准备ok,EMM…有条件的做备份(快照)

[root@seahub ~]#cd seafile-server-8.0.2/ #进去安装目录
[root@seahub ~]#./setup-seafile-mysql.sh #开始安装

Checking python on this machine …

This script will guide you to setup your seafile server using MySQL.
Make sure you have read seafile server manual at
https://download.seafile.com/published/seafile-manual/home.md

Press ENTER to continue #回车开始安装

What is the name of the server? It will be displayed on the client.
3 – 15 letters or digits
[ server name ] seahub #服务器名,随便输也可以
What is the ip or domain of the server?
For example: www.mycompany.com, 192.168.1.101
[ This server’s ip or domain ] 192.168.1.3 #IP地址或域名
Which port do you want to use for the seafile fileserver?

[ default “8082” ] #端口默认即可

Please choose a way to initialize seafile databases:

[1] Create new ccnet/seafile/seahub databases
[2] Use existing ccnet/seafile/seahub databases
[ 1 or 2 ] 1 #选择1
What is the host of mysql server?
[ default “localhost” ] #数据库地址,无特殊需求,默认
What is the port of mysql server?
[ default “3306” ] #数据库端口,无特殊需求默认
What is the password of the mysql root user?
[ root password ]PassW0rd #上面设置的数据库管理密码
verifying password of user root … done
Enter the name for mysql user of seafile. It would be created if not exists.
[ default “seafile” ] #默认,直接回车
Enter the password for mysql user “seafile”:
[ password for seafile ] #默认,直接回车
Enter the database name for ccnet-server:
[ default “ccnet-db” ] #默认,直接回车
Enter the database name for seafile-server:
[ default “seafile-db” ] #默认,直接回车
Enter the database name for seahub:

[ default “seahub-db” ] #默认,直接回车

This is your configuration

server name:            seahub
server ip/domain:       192.168.1.3
seafile data dir:       /opt/seafile/seafile-data
fileserver port:        8082
database:               create new
ccnet database:         ccnet-db
seafile database:       seafile-db
seahub database:        seahub-db

database user: seafile

Press ENTER to continue, or Ctrl-C to abort #确认上述信息无误,直接回车

Generating ccnet configuration …
Generating seafile configuration …
done

Generating seahub configuration …

Now creating ccnet database tables …


Now creating seafile database tables …


Now creating seahub database tables …

creating seafile-server-latest symbolic link … done

Your seafile server configuration has been finished successfully.

run seafile server: ./seafile.sh { start | stop | restart }

run seahub server: ./seahub.sh { start | stop | restart }

If you are behind a firewall, remember to allow input/output of these tcp ports:

port of seafile fileserver: 8082
port of seahub: 8000
When problems occur, Refer to
https://download.seafile.com/published/seafile-manual/home.md
for information.

安装完成

[root@seahub ~]# cd /opt/seafile/
[root@seahub ~]#tree -L 2 #查看一下目录结构,看不看都行,本人强迫症
.
├── ccnet
├── conf
│ ├── ccnet.conf
│ ├── gunicorn.conf.py
│ ├── seafdav.conf
│ ├── seafile.conf
│ └── seahub_settings.py
├── installd
│ └── seafile-server_8.0.2_x86-64.tar.gz
├── seafile-data
│ └── library-template
├── seafile-server-8.0.2
│ ├── check_init_admin.py
│ ├── reset-admin.sh
│ ├── runtime
│ ├── seaf-fsck.sh
│ ├── seaf-fuse.sh
│ ├── seaf-gc.sh
│ ├── seafile
│ ├── seafile.sh
│ ├── seahub
│ ├── seahub.sh
│ ├── setup-seafile-mysql.py
│ ├── setup-seafile-mysql.sh
│ ├── setup-seafile.sh
│ ├── sql
│ └── upgrade
├── seafile-server-latest -> seafile-server-8.0.2
└── seahub-data
└── avatars

14 directories, 16 files

此处已安装完成,接下来启动Seafile

[root@seahub ~]#/opt/seafile/seafile-server-latest/./seafile.sh start
[root@seahub ~]#/opt/seafile/seafile-server-latest/./seahub.sh start #第一次需要设置邮箱和管理员密码,比较简单,不做详细介绍

添加开机启动

[root@seahub ~]#vim /etc/rc.d/rc.local #按i键,插入一下内容,ESC:wq保存
/opt/seafile/seafile-server-latest/./seafile.sh start
/opt/seafile/seafile-server-latest/./seahub.sh start
[root@seahub ~]#chmod +x /etc/rc.d/rc.local

接下来,127.0.0.1:8000可以访问了,但是其它地址不能访问,此时需要配置Nginx反向代{过}{滤}理才行

[root@seahub ~]#yum install nginx #安装Nginx
[root@seahub ~]# vi /etc/nginx/nginx.conf #修改nginx配置文件,修改后的如下

For more information on configuration, see:

* Official English Documentation: http://nginx.org/en/docs/

* Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.

include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;
}

http {
log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;

access_log  /var/log/nginx/access.log  main;

sendfile            on;
tcp_nopush          on;
tcp_nodelay         on;
keepalive_timeout   65;
types_hash_max_size 2048;

include             /etc/nginx/mime.types;
default_type        application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name 192.168.1.3;

proxy_set_header X-Forwarded-For $remote_addr;

location / {
     proxy_pass         http://127.0.0.1:8000;
     proxy_set_header   Host $host;
     proxy_set_header   X-Real-IP $remote_addr;
     proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header   X-Forwarded-Host $server_name;
     proxy_read_timeout  1200s;

     # used for view/edit office file via Office Online Server
     client_max_body_size 0;

     access_log      /var/log/nginx/seahub.access.log;
     error_log       /var/log/nginx/seahub.error.log;
}
location /seafhttp {
    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://127.0.0.1:8082;
    client_max_body_size 0;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;

    send_timeout  36000s;
}
location /media {
    root /opt/seafile/seafile-server-latest/seahub;
}

}

Settings for a TLS enabled server.

#

server {

listen 443 ssl http2 default_server;

listen [::]:443 ssl http2 default_server;

server_name _;

root /usr/share/nginx/html;

#

ssl_certificate “/etc/pki/nginx/server.crt”;

ssl_certificate_key “/etc/pki/nginx/private/server.key”;

ssl_session_cache shared:SSL:1m;

ssl_session_timeout 10m;

ssl_ciphers PROFILE=SYSTEM;

ssl_prefer_server_ciphers on;

#

# Load configuration files for the default server block.

include /etc/nginx/default.d/*.conf;

#

location / {

}

#

error_page 404 /404.html;

location = /40x.html {

}

#

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}

}

[root@seahub ~]# systemctl enable nginx #配置nginx开机启动
[root@seahub ~]# firewall-cmd –permanent –zone=public –add-port=80/tcp #防火墙端口开放,Emm…这个差点忘了
[root@seahub ~]# firewall-cmd –permanent –zone=public –add-port=8000/tcp
[root@seahub ~]# firewall-cmd –permanent –zone=public –add-port=8082/tcp
[root@seahub ~]# systemctl restart firewalld.service #重启防火墙
[root@seahub ~]# setenforce 0 #临时关闭selinu
[root@seahub ~]# vi /etc/sysconfig/selinux #永久关闭selinu
#SELINUX=enforcing 改为 SELINUX=disabled #永久关闭selinux

安装到此结束,访问:http://192.168.1.3,试试看#使用教程参考官网或自行摸索

ibrar

官网地址:https://www.seafile.com/

access接口或TRUNK接口配置

重要说明:

如果交换机端口配置为TRUNK,默认允许所有本交换机已创建VLAN的报文通过,全网TRUNK互联的情况下,整网的广播组播未知名单播都可能会泛洪到交换机上,导致端口、链路拥塞、大量协议报文(例如ARP)送CPU处理导致设备管理面出现异常(无法管理,CLI响应慢等现象),所以在项目实施中,规范性要求端口务必配置TRUNK裁减,只允许放通的VLAN报文通过。

1. 交换机access口配置

将交换机的10号口配置为access口,并且属于vlan100

Ruijie>enable

Ruijie(config)#interface gigabitEthernet 1/10

Ruijie(config-if-GigabitEthernet 1/10)#switchport access vlan 100

Ruijie(config-if-GigabitEthernet 1/10)#end

Ruijie#write

说明:

交换机如果没有配置,那么默认所有端口都是access口。如果端口被配置为trunk口,需要改为access口,需要先在接口下敲switchport mode access,否则不生效,例如原来的trunk口配置改为access口,属于access vlan 100,命令如下:

Ruijie#show run interface gigabitEthernet 1/10                ——>查看配置

Building configuration…

Current configuration : 56 bytes

interface GigabitEthernet 1/10

switchport mode trunk

Ruijie#configure terminal

Ruijie(config)#interface gigabitEthernet 1/10

Ruijie(config-if-GigabitEthernet 1/10)#switchport mode access    ——>设置为access模式

Ruijie(config-if-GigabitEthernet 1/10)#switchport access vlan 100

Ruijie(config-if-GigabitEthernet 1/10)#end

查看配置

Ruijie(config-if-GigabitEthernet 1/10)#show vlan

VLAN Name                             Status    Ports

—- ——————————– ——— ———————————–

   1 VLAN0001                         STATIC    Gi1/1, Gi1/2, Gi1/3, Gi1/4           

                                                Gi1/5, Gi1/6, Gi1/7, Gi1/8           

                                                Gi1/9, Gi1/13, Gi1/14, Gi1/15         

                                                Gi1/16, Gi1/17, Gi1/18, Gi1/19       

                                                Gi1/20, Gi1/21, Gi1/22, Gi1/23       

                                                Gi1/24, Gi1/25, Gi1/26, Gi1/27       

                                                Gi1/28, Gi1/29, Gi1/30, Gi1/31       

                                                Gi1/32, Gi1/33, Gi1/34, Gi1/35       

                                                Gi1/36, Gi1/37, Gi1/38, Gi1/39       

                                                Gi1/40, Gi1/41, Gi1/42, Gi1/43       

                                                Gi1/44, Te1/45, Te1/46, Te1/47       

                                                Te1/48, Gi4/1, Gi4/2, Gi4/3          

 100 VLAN0100                       STATIC    Gi1/1, Gi1/10, Te1/45, Te1/46        

                                                Te1/47                      

2. 交换机TRUNK口配置

将交换机的45号口配置为trunk口

Ruijie(config)#interface TenGigabitEthernet 1/45

Ruijie(config-if-TenGigabitEthernet 1/45)#switchport mode trunk

Ruijie(config-if-TenGigabitEthernet 1/45)#end

查看配置

Ruijie#show interfaces trunk

Interface                        Native VLAN VLAN lists

——————————– ———– ———————-

TenGigabitEthernet 1/45        1           ALL                         ——>native vlan是1,ALL表示允许所有的vlan通过

TenGigabitEthernet 1/46          1           ALL

TenGigabitEthernet 1/47          1           ALL

3. TRUNK口VLAN裁剪(必配)

交换机的1号口配置为trunk口,并且只允许vlan 5、vlan 10、vlan20-30通过,其余vlan不允许通过

Ruijie#configure terminal

Ruijie(config)#interface gigabitEthernet 1/1

Ruijie(config-if-GigabitEthernet 1/1)#switchport mode trunk

Ruijie(config-if-GigabitEthernet 1/1)#switchport trunk allowed vlan remove 1-4,6-9,11-19,31-4094   ——>交换机默认允许所有本地已创建的vlan通过,如果只需要配置只允许相应vlan通过,需要把不允许通过的vlan给裁剪掉

Ruijie(config-if-GigabitEthernet 1/1)#end

Ruijie#wr

RJ恢复出厂设置

一、可以正常进入设备运行模式的情况下:

1、进入特权模式

Ruijie>enable                 ——>进入特权模式

2、查看设备flash当前文件列表

Ruijie#dir                      ——->查看flash当前文件列表

Directory of flash:/

    Mode Link      Size          MTime                    Name

———– —- ———– ————————— —————

                 1      2840      2016-10-23 17:05:09     config.text     ——->保存配置的文件名”config.text“

   <DIR>    1         0        1970-01-01 00:00:00     dev/

   <DIR>    2         0        2007-01-01 16:37:59     mnt/

                 1         8        2016-10-14 14:54:17     priority.dat

   <DIR>    0         0        1970-01-01 00:00:00     proc/

   <DIR>    1         0        2016-10-12 09:49:12     ram/

                 1  13138784   2007-01-01 16:38:17     rgos.bin

   <DIR>    2         0        2016-10-12 09:49:55     tmp/

   <DIR>    4         0        2007-01-01 16:40:06     web/

                 1   5845952   2007-01-01 16:40:05     web_management_pack.upd

————————————————————————

3 Files (Total size 18984744 Bytes), 6 Directories.

Total 132120576 bytes (126MB) in this device, 108597248 bytes (103MB) available.

3、将配置文件config.text删除

Ruijie#delete config.text                     —–>删除配置文件“config.text”

Are you sure you want to delete “config.text”? [No/yes]y

File “config.text” is deleted.

部分设备的命令如下:

Ruijie#delete flash:/config.text             —–>删除配置文件“config.text”

Are you sure you want to delete “/config.text”? [No/yes]y

File “/config.text” is deleted.            

4、重启设备,重启后设备恢复出厂设置:

Ruijie#reload              —–>重启交换机

Proceed with reload? [no]y 

锐捷命令

直接重启

表示立即重启设备,用户可以在特权模式下直接键入 reload 命令来重启系统。

查看运行情况

show boot config

显示启机配置保存的路径和文件名

show clock

显示当前系统时间。

show line { console line-num | vty line-num | line-num }

查看线路的配置信息。

show reload

查看系统的重新启动设置。

show running-config [ interface interface ]

查看当前设备系统正在运行的配置信息或某个接口下的配置信息。

show startup-config

查看存储在 NVRAM(非易失性随机存取存储器)上设备的配置。

show this

查看系统当前模式下生效的配置信息。

HTTP 服务

使能 HTTP 服务

缺省情况下,HTTP 服务功能关闭。

使用 enable service web-server 命令可以使能 HTTP 服务功能,包括 HTTP 服务和 HTTPS 服务。

必须使能 HTTP 服务功能,用户才能通过 Web 界面登陆到设备中进行配置与管理。

æ

配置 HTTP 认证信息

缺省情况下,已经配置了级别为 0、用户名 admin、密码 admin 的认证信息。

使用 webmaster level 命令可以配置认证的用户名和密码。

通过配置该命令,用户需要输入所配置的用户名和密码进行认证才能登陆 Web 页面。

配置 HTTP 服务端口

缺省情况下,HTTP 服务端口为 80。

使用 http port 命令可以配置 HTTP 服务端口号,取值范围是 80 及 1025-65535。

通过配置 HTTP 服务端口号,可以减少非法用户对 HTTP 服务的攻击。

æ

配置 HTTPS 服务端口

缺省情况下,HTTPS 服务端口为 443。

使用 http secure-port 命令可以配置 HTTPS 服务端口号,取值范围是 443 及 1025-65535。

通过配置 HTTPS 服务端口号,可以减少非法用户对 HTTPS 服务的攻击。

相关命令

æ

使能 HTTP 服务

【命令格式】 enable service web-server [ http | https | all ]

【参数说明】 http | https | all:打开相应的服务。http 为打开 HTTP 服务,https 为打开 HTTPS 服务,all 为同时打开 HTTP

和 HTTPS 服务。缺省为同时打开 HTTP 和 HTTPS 服务。

【命令模式】 全局模式

【使用指导】 如果执行该命令时后面不跟任何关键字或者跟 all,则表示同时打开 HTTP 服务和 HTTPS 服务;如果跟 http

关键字,则表示只打开 HTTP 服务;如果跟 https 关键字,则表示只打开 HTTPS 服务。

使用 no enable service web-server 或者 default enable service web-server 用于关闭相应的 HTTP 服务。

如果该 no 命令或 default 命令后面不跟任何关键字,则表示关闭 HTTP 服务和 HTTPS 服务。

æ

配置 HTTP 认证信息

【命令格式】 webmaster level privilege-level username name password { password | [ 0 | 7 ] encrypted-password }

【参数说明】 privilege-level:用户绑定权限等级。

name:用户名。

password:用户口令。

0 | 7:口令的加密类型,0 无加密,7 简单加密。缺省为 0。

encrypted-password:口令文本。

【命令模式】 全局模式

【使用指导】 在使用 HTTP Server 的时候,需要进行登陆认证才能进入 Web 页面。使用该命令配置 Web 登陆认证的用户

名和密码。

执行 no webmaster level privilege-level 删除指定权限等级的所有用户名与密码。5-7

配置指南

HTTP 服务

执行 no webmaster level privilege-level username name 删除指定用户名和密码。

用户名和密码有三个权限等级;每个权限等级最多可以配置 10 个用户名和密码。

系统默认创建两个账号,admin 账号和 guest 账号,这两个账号不可被删除,只可修改密码。其中 guest

账号默认对应 level 2 权限,在 web 端只拥有查看系统首页的权限。管理员账号为 admin 对应 level 0 权

限,在 web 端管理员账号拥有所有的功能,并且可以编辑其他管理账号并授权该账号可访问的页面,新

添加的账号

PoE 供电

配置端口供电管理策略

【网络环境】 = 端口 g0/1 要求稳定供电,尽量不受网络环境影响。

= 端口在每日 8:00 到 12:00 时间段下电,其他时间上电。

= 端口最大供电功率不超过 17W。

【配置方法】 = 配置 g0/1 口优先级为 critical。

= 配置 time-range,并关联 PoE 的端口 time-range 配置。

= 配置 g0/1 端口最大功率为 15.4W。

Ruijie# configure terminal

Ruijie(config)# time-range poe-time

Ruijie(config-time-range)# periodic daily 8:00 to 12:00

Ruijie(config-time-range)# exit

Ruijie(config)# interface gigabitEthernet 0/1

Ruijie(config-if)# poe power-off time-range poe-time

Ruijie(config-if)# poe priority critical

Ruijie(config-if)# poe max-power 15.4

【检验方法】 通过 show poe interface gigabitEthernet 0/1 可以查看到配置信息以及供电信息。12-13

命令参考

PoE

Ruijie#show poe interface gigabitEthernet 0/1

Interface : gi0/1

Power enabled : enable

Power status : on

Max power : 15.4W

Allocate power : N/A

Current power : 14.8 W

Average power : 14.8 W

Peak power : 14.8 W

LLDP requested power : N/A

LLDP allocated power : N/A

Voltage : 53.5 V

Current : 278 mA

PD class : 4

Trouble cause : None

Priority : critical

Legacy : off

Power-off time-range : poe-time

Power management : auto

查看运行情况

作用

命令

查看指定端口的 PoE 配置和状态信息 show poe interface12-16

命令参考

PoE

查看所有端口的 PoE 状态或配置

show poe interfaces

查看当前 PoE 系统的供电状态

show poe powersupply

RJ设置交换机的默认网关

重要说明:

1)配置默认网关是二层交换机需要进行远程跨网段管理时的必配功能。

2)对于三层交换机,配置默认网关属于静态路由,当然设备也可以通过动态路由协议来学习网络路由,实现远程管理,关于其他路由协议的配置防范,可参考:IP路由 (配置方式参见 常用功能配置>IP路由)

设置交换机的默认网关

二层交换机配置管理IP地址的默认网关

Ruijie>enable 

Ruijie#configure terminal

Ruijie(config)#ip default-gateway 192.168.1.254        ——>设置交换机的默认网关为192.168.1.254

Ruijie(config)#end

Ruijie#write     ——>确认配置正确,保存配置

三层交换机配置交换机的默认网关,即配置交换机的默认路由

Ruijie>enable 

Ruijie#configure terminal

Ruijie(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.254     ——>设置交换机的默认网关为192.168.1.254

Ruijie(config)#end

Ruijie#write     ——>确认配置正确,保存配置

查看配置

二层交换机查看网关配置的命令如下:

Ruijie#show ip redirects

default-gateway: 192.168.1.254

三层层交换机查看网关配置的命令如下:

Ruijie#show ip route

Codes:  C – connected, S – static, R – RIP, B – BGP

        O – OSPF, IA – OSPF inter area

        N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2

        E1 – OSPF external type 1, E2 – OSPF external type 2

        i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2

        ia – IS-IS inter area, * – candidate default

Gateway of last resort is 192.168.1.254 to network 0.0.0.0

S*   0.0.0.0/0 [1/0] via 192.168.1.254

RJ创建管理IP

创建管理IP

二层交换机由于不支持路由口,只能使用SVI进行管理,三层交换机的设备管理地址可以采用SVI或路由口进行管理。

二层交换机:

二层交换机配置IP地址是用于管理设备使用,比如使用Telnet、SNMP等等。

配置命令:

Ruijie>enable 

Ruijie#configure terminal

Ruijie(config)#interface vlan 1     ——>进入vlan接口,实际使用中建议使用非VLAN 1

Ruijie(config-if-VLAN 1)#ip address 192.168.1.1 255.255.255.0

Ruijie(config-if-VLAN 1)#end

Ruijie#write                                 ——>确认配置正确,保存配置

说明:

1、如果不是vlan 1,是其他vlan,在进入vlan接口配置时,需要先创建相应的vlan,否则会提示失败。例如创建vlan 100的ip地址为192.168.100.1/24,命令如下:

Ruijie(config)#vlan 100

Ruijie(config-vlan)#exit

Ruijie(config)#interface vlan 100

Ruijie(config-if-VLAN 100)#ip address 192.168.100.1 255.255.255.0

Ruijie(config-if-VLAN 100)#end

Ruijie#

注意:二层交换机如果配置多个SVI,并配置地址,则原有已经UP并生效的SVI将会被shutdown

2、如果要创建SVI的Secondary地址,在配置第二个地址的时候,后面再加一个secondary,否则会覆盖原有地址。

例如创建SVI 100的secondary地址为192.168.10.1/24可以通过如下命令实现:

Ruijie(config)#vlan 100

Ruijie(config-vlan)#exit

Ruijie(config)#interface vlan 100

Ruijie(config-if-VLAN 100)#ip address 192.168.100.1 255.255.255.0

Ruijie(config-if-VLAN 100)#ip address 192.168.10.1 255.255.255.0 secondary

Ruijie(config-if-VLAN 100)#end

Ruijie#

三层交换机:

三层交换机配置地址可用于管理,也可以用于通信,比如作为用户的网关。

配置方法1:

Ruijie>enable 

Ruijie#configure terminal

Ruijie(config)#interface vlan 10

Ruijie(config-if-VLAN 10)#ip address 192.168.1.1 255.255.255.0

Ruijie(config-if-VLAN 10)#end

Ruijie#write      ——>确认配置正确,保存配置

说明:如果不是vlan 1,是其他vlan,在进入vlan接口配置时,需要先创建相应的vlan,否则会提示失败。

配置方法2(需确保交换机是三层交换机):

Ruijie>enable 

Ruijie#configure terminal

Ruijie(config)#int FastEthernet 0/1

Ruijie(config-if-FastEthernet 0/1)#no switchport     ——>将端口设置为三层口,配置IP地址之前必须要先变为三层口,否则无法配置IP地址

Ruijie(config-if-FastEthernet 0/1)#ip add 192.168.16.1 255.255.255.0

Ruijie(config-if-FastEthernet 0/1)#end

Ruijie#write     ——>确认配置正确,保存配置

查看配置

Ruijie#show ip int brief

Interface                        IP-Address(Pri)      IP-Address(Sec)            Status                 Protocol

GigabitEthernet 0/1              192.168.16.1/24           no address                up                   up   

VLAN 10                             192.168.1.1/24       no address                up                        up   

VLAN 100                         192.168.100.1/24     192.168.10.1/24      up                       up  

Rj交换机命名

交换机命名

默认大多数设备的名字是“Ruijie”,可以使用以下命令修改交换机的命名。

Ruijie>en

Ruijie#configure terminal

Ruijie(config)#hostname Switch           ——>设置交换机的名字为”Switch”

Switch(config)#end

Switch#write                                        ——>确认配置正确,保存

锐捷网络命令模式

命令模式

锐捷网络设备管理界面分成若干不同的模式,用户当前所处的命令模式决定了可以使用的命令。在命令提示符下输入问号键(?)可以列出每个命令模式支持使用的命令。

下表列出了命令的模式、如何访问每个模式、模式的提示符、如何离开模式。这里假定网络设备的名字为缺省的“Ruijie”。命令模式概要:

命令模式访问方法提示符离开或访问下一模式关于该模式
User EXEC (用户模式)访问网络设备时首先进入该模式。Ruijie>输入exit命令离开该模式。 要进入特权模式,输入enable命令。使用该模式来进行基本测试、显示系统信息
Privileged EXEC (特权模式)在用户模式下,使用enable命令进入该模式。Ruijie#要返回到用户模式,输入disable命令。 要进入全局配置模式,输入configure命令。使用该模式来验证设置命令的结果。该模式是具有口令保护的。
Global configuration (全局配置模式)在特权模式下,使用configure命令进入该模式。Ruijie(config)#要返回到特权模式,输入exit命令或end命令,或者键入Ctrl+C组合键。 要进入接口配置模式,输入interface 命令。在interface命令中必须指明要进入哪一个接口配置子模式。 要进入VLAN配置模式,输入vlan vlan_id命令。使用该模式的命令来配置影响整个网络设备的全局参数。
Interface configuration (接口配置模式)在全局配置模式下,使用interface命令进入该模式。Ruijie(config-if)#要返回到特权模式,输入end命令,或键入Ctrl+C组合键。要返回到全局配置模式,输入exit命令。在interface命令中必须指明要进入哪一个接口配置子模式。使用该模式配置网络设备的各种接口。
Config-vlan (VLAN配置模式)在全局配置模式下,使用vlan vlan_id命令进入该模式。Ruijie(config-vlan)#要返回到特权模式,输入end命令,或键入Ctrl+C组合键。 要返回到全局配置模式,输入exit命令。使用该模式配置VLAN参数。

CentOS修改时区、日期、时间

一、时区

显示时区

date --help 获取帮助
date -R
date +%z

修改时区

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  

hwclock -w 写入硬件,避免重启失效

二、时间

概念:Linux时间有两个
系统时间:也叫软件时间(sys), 1970年1月1日到当前时间的秒数
BOIS时间:也叫硬件时间(hc)
显示时间

[root@localhost ~]# date;hwclock -r
Fri Feb 17 11:24:50 CST 2019
Fri 17 Feb 2019 11:25:00 AM CST  -10.015012 seconds

设置时间
1、date -s

date -s 20121019
date -s 23:40:00

2、ntpdate

安装ntp:
yum install -y ntp

ntpdate time.windows.com && hwclock -w  同步时间且写入硬件