初始文档
This commit is contained in:
38
软件or平台使用/ELK笔记.md
Normal file
38
软件or平台使用/ELK笔记.md
Normal file
@@ -0,0 +1,38 @@
|
||||
elastic
|
||||
+IfGiU_tAw=pXHt1RnES
|
||||
|
||||
kibana_system
|
||||
A-PajW36E9tJjDnKOdUm
|
||||
|
||||
HTTP CA certificate SHA-256 fingerprint:
|
||||
c4a63732232b28cdb46435b94d412cc172d5323baf297d323c20d8c837c059dc
|
||||
|
||||
```sh
|
||||
# 启动elastic容器
|
||||
docker run --name es01 --net vlan100 -p 9200:9200 -p 9300:9300 -t docker.elastic.co/elasticsearch/elasticsearch:8.9.0
|
||||
# 启动kibana容器
|
||||
docker run --name kib01 --net vlan100 -p 5601:5601 docker.elastic.co/kibana/kibana:8.9.0
|
||||
|
||||
docker run -h filebeat --name=filebeat --network vlan100 -v /data/docker_data/filebeat:/var/data docker.elastic.co/beats/filebeat:8.9.0 setup -E setup.kibana.host=172.18.0.7:5601 -E output.elasticsearch.hosts=["172.18.0.8:9200"]
|
||||
|
||||
# 生成kibana验证码
|
||||
docker exec -it kib01 /usr/share/kibana/bin/kibana-verification-code
|
||||
|
||||
# 重置es用户密码
|
||||
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-reset-password --username kibana_system
|
||||
|
||||
# 重新生成elastic注册秘钥
|
||||
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
|
||||
# 加入elastic集群
|
||||
docker run -e ENROLLMENT_TOKEN="<token>" --name es02 --net elastic -it docker.elastic.co/elasticsearch/elasticsearch:8.9.0
|
||||
|
||||
# 重新生成kibana注册秘钥
|
||||
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
|
||||
```
|
||||
## elastc容器启动失败
|
||||
```sh
|
||||
# 设置虚拟内存,临时生效
|
||||
sysctl -w vm.max_map_count=262144
|
||||
# 永久生效在/etc/sysctl.conf添加
|
||||
vm.max_map_count=262144
|
||||
```
|
||||
205
软件or平台使用/K8S笔记.md
Normal file
205
软件or平台使用/K8S笔记.md
Normal file
@@ -0,0 +1,205 @@
|
||||
crio运行时套接字` unix:///var/run/crio/crio.sock`
|
||||
kubeadm:用来初始化集群的指令。
|
||||
kubelet:在集群中的每个节点上用来启动 Pod 和容器等。
|
||||
kubectl:用来与集群通信的命令行工具。
|
||||
## 基础要求
|
||||
```sh
|
||||
|
||||
## centos系列
|
||||
# 关闭防火墙和开机自起
|
||||
systemctl disable --now firewalld
|
||||
# 关闭selinux
|
||||
setenforce 0
|
||||
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
|
||||
|
||||
# ubuntu系列
|
||||
systemctl disable --now ufw
|
||||
|
||||
# 关闭交换内存
|
||||
swapoff -a && sed -i "$(grep swap -n /etc/fstab |awk -F: '{print $1}')c $(grep swap /etc/fstab | sed 's/^/#/')" /etc/fstab
|
||||
|
||||
# 转发ipv4流量
|
||||
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
|
||||
overlay
|
||||
br_netfilter
|
||||
EOF
|
||||
|
||||
sudo modprobe overlay
|
||||
sudo modprobe br_netfilter
|
||||
|
||||
# 设置所需的 sysctl 参数,参数在重新启动后保持不变
|
||||
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
|
||||
net.bridge.bridge-nf-call-iptables = 1
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
net.ipv4.ip_forward = 1
|
||||
vm.swappiness = 0
|
||||
EOF
|
||||
|
||||
# 应用 sysctl 参数而不重新启动
|
||||
sudo sysctl --system
|
||||
# 检查模块是否加载
|
||||
lsmod | grep br_netfilter
|
||||
lsmod | grep overlay
|
||||
|
||||
# 检查流量转发是否设为1
|
||||
sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward
|
||||
```
|
||||
|
||||
|
||||
## 导入阿里云k8s仓库
|
||||
```sh
|
||||
# centos系
|
||||
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
|
||||
[kubernetes]
|
||||
name=Kubernetes
|
||||
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
repo_gpgcheck=1
|
||||
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
|
||||
EOF
|
||||
setenforce 0
|
||||
yum install -y kubeadm-1.24.0-0 kubelet-1.24.0-0 kubectl-1.24.0-0
|
||||
systemctl enable kubelet && systemctl start kubelet
|
||||
```
|
||||
```sh
|
||||
# ubunut系
|
||||
apt-get update && apt-get install -y apt-transport-https
|
||||
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
|
||||
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
|
||||
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
|
||||
EOF
|
||||
apt-get update
|
||||
apt-get install -y kubeadm-1.24.0-0 kubelet-1.24.0-0 kubectl-1.24.0-0
|
||||
systemctl enable --now kubelet
|
||||
```
|
||||
## docker镜像加速
|
||||
```sh
|
||||
sudo mkdir -p /etc/docker
|
||||
sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://8jl29epx.mirror.aliyuncs.com"] } EOF
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart docker
|
||||
```
|
||||
## 安装kubectl
|
||||
```sh
|
||||
# 下载指定版本的kubectl程序
|
||||
curl -LO https://dl.k8s.io/release/v1.24.0/bin/linux/amd64/kubectl
|
||||
curl -LO https://dl.k8s.io/release/v1.24.0/bin/linux/amd64/kubectl.sha256
|
||||
# 校验256值
|
||||
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
|
||||
# 安装kubectl到系统
|
||||
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
||||
```
|
||||
|
||||
安装容器运行时
|
||||
```sh
|
||||
# centos系统安装
|
||||
export OS=CentOS_7
|
||||
export VERSION=1.24
|
||||
curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/devel:kubic:libcontainers:stable.repo
|
||||
curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/devel:kubic:libcontainers:stable:cri-o:$VERSION.repo
|
||||
yum install cri-o containernetworking-plugins
|
||||
|
||||
# ubuntu系统安装
|
||||
export OS=xUbuntu_20.04
|
||||
export VERSION=1.24
|
||||
echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||
echo "deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list
|
||||
|
||||
mkdir -p /usr/share/keyrings
|
||||
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg
|
||||
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg
|
||||
|
||||
apt-get update
|
||||
apt-get install cri-o cri-o-runc
|
||||
systemctl enable --now crio
|
||||
```
|
||||
|
||||
- 安装cni
|
||||
```sh
|
||||
git clone https://github.com/containernetworking/plugins
|
||||
cd plugins
|
||||
git checkout v1.1.1
|
||||
wget https://golang.google.cn/dl/go1.18.10.linux-amd64.tar.gz
|
||||
tar -C /usr/local -xzf go1.18.10.linux-amd64.tar.gz
|
||||
echo "export PATH=${PATH}:/usr/local/go/bin" >> /etc/profile
|
||||
source /etc/profile
|
||||
./build_linux.sh
|
||||
sudo mkdir -p /opt/cni/bin
|
||||
sudo cp bin/* /opt/cni/bin/
|
||||
```
|
||||
|
||||
### 网络配置文件
|
||||
- 10-crio-bridge.conflist文件内容
|
||||
```yaml
|
||||
{
|
||||
"cniVersion": "1.0.0",
|
||||
"name": "crio",
|
||||
"plugins": [
|
||||
{
|
||||
"type": "bridge",
|
||||
"bridge": "cni0",
|
||||
"isGateway": true,
|
||||
"ipMasq": true,
|
||||
"hairpinMode": true,
|
||||
"ipam": {
|
||||
"type": "host-local",
|
||||
"routes": [
|
||||
{ "dst": "0.0.0.0/0" },
|
||||
{ "dst": "::/0" }
|
||||
],
|
||||
"ranges": [
|
||||
[{ "subnet": "192.168.2.0/24" }],
|
||||
[{ "subnet": "1100:200::/24" }]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
> `sudo cp 10-crio-bridge.conflist /etc/cni/net.d`
|
||||
|
||||
|
||||
|
||||
## 安装阿里k8s组件
|
||||
```sh
|
||||
for i in `kubeadm config images list`; do
|
||||
imageName=`echo ${i} |awk -F '/' '{print $2}'`
|
||||
docker pull registry.aliyuncs.com/google_containers/$imageName
|
||||
docker tag registry.aliyuncs.com/google_containers/$imageName registry.k8s.io/$imageName
|
||||
docker rmi registry.aliyuncs.com/google_containers/$imageName
|
||||
done;
|
||||
```
|
||||
|
||||
## 导出配置文件
|
||||
```sh
|
||||
kubeadm config print init-defaults > kubeadm-config.yaml
|
||||
cat <<EOF > /etc/kubernetes/kubelet-config.yaml
|
||||
apiVersion: kubelet.config.k8s.io/v1beta1
|
||||
kind: KubeletConfiguration
|
||||
address: "192.168.225.138"
|
||||
port: 20250
|
||||
serializeImagePulls: false
|
||||
evictionHard:
|
||||
memory.available: "200Mi"
|
||||
cgroupDriver: systemd
|
||||
EOF
|
||||
```
|
||||
```sh
|
||||
# 下载kube镜像
|
||||
kubeadm config images pull
|
||||
|
||||
# 初始化集群
|
||||
sudo kubeadm init \
|
||||
--pod-network-cidr=10.244.0.0/16 \ # 指定cidr网络
|
||||
--cri-socket=unix:///var/run/crio/crio.sock \ #指定运行时
|
||||
--image-repository registry.aliyuncs.com/google_containers \ # 指定组建镜像仓库
|
||||
--kubernetes-version=v1.24.0 \ # 指定k8s版本
|
||||
--ignore-preflight-errors=all \ # 忽略所有警告
|
||||
--apiserver-advertise-address=192.168.10.253 \ # 指定控制平面api server地址192.168.0.0/12
|
||||
# 创建集群,指定containerd为运行时
|
||||
sudo kubeadm init --pod-network-cidr=17.72.0.0/24 --cri-socket=unix:///var/run/containerd/containerd.sock
|
||||
|
||||
# 使用docker引擎
|
||||
--cri-socket=/var/run/dockershim.sock
|
||||
```
|
||||
188
软件or平台使用/PXE引导.md
Normal file
188
软件or平台使用/PXE引导.md
Normal file
@@ -0,0 +1,188 @@
|
||||
|
||||
```sh
|
||||
# 设置变量
|
||||
alias cp='cp'
|
||||
centos7_iso='https://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/os/x86_64/'
|
||||
ubuntu_iso'https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04.2-live-server-amd64.iso'
|
||||
dhip=$(ip addr |grep inet -w|awk -F' ' '{print $2}'|sed -n '2p' |awk -F'/' '{print $1}')
|
||||
dhipNet=$(echo ${dhip:0:-$(expr length `echo $dhip |cut -d '.' -f4`)})
|
||||
dhipStart=${dhipNet}100
|
||||
dhipEnd=${dhipNet}200
|
||||
|
||||
# 关闭selinux
|
||||
echo '- 关闭selinux'
|
||||
setenforce 0
|
||||
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
|
||||
# 关闭防火墙
|
||||
echo '- 关闭防火墙'
|
||||
systemctl stop firewalld
|
||||
# 安装软件
|
||||
echo -e '开始安装tftp/xinetd/vsftpd/syslinux...\n'
|
||||
yum install tftp-server xinetd vsftpd syslinux-4.05 dhcp-4.2.5 -y > /dev/null
|
||||
|
||||
if [ ! -e /var/ftp/centos7 ]
|
||||
then
|
||||
mkdir -p /var/ftp/centos7
|
||||
elif [ ! -e /mnt/centos7 ]
|
||||
then
|
||||
mkdir -p /mnt/centos7
|
||||
fi
|
||||
mount -o loop /dev/sr0 /mnt/centos7
|
||||
if [[ $? -eq 0 || -s /mnt/centos7/isolinux ]]
|
||||
then
|
||||
echo '拷贝镜像文件到ftp目录下'
|
||||
cp -rf /mnt/centos7/* /var/ftp/centos7/
|
||||
else
|
||||
echo -e '未挂载iso文件,将使用华为镜像站镜像!\n'
|
||||
# 在华为镜像站下载启动文件,也可以用本地iso镜像里的文件,拷贝到/var/lib/tftpboot目录即可
|
||||
echo '开始下载初始化文件'
|
||||
wget -P /var/lib/tftpboot/ --no-check-certificate ${centos7_iso}images/pxeboot/initrd.img
|
||||
echo '开始下载内核文件'
|
||||
wget -P /var/lib/tftpboot/ --no-check-certificate ${centos7_iso}images/pxeboot/vmlinuz
|
||||
|
||||
fi
|
||||
sed -i 's/yes/no/g' /etc/xinetd.d/tftp
|
||||
# grep -v "^#" /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example |grep -v "^$"| grep -v "opt*" |head -n5
|
||||
|
||||
# 配置dhcp
|
||||
cat > /etc/dhcp/dhcpd.conf << EOF
|
||||
log-facility local7;
|
||||
ignore client-updates;
|
||||
# 创建地址池
|
||||
subnet ${dhipNet}0 netmask 255.255.255.0{
|
||||
range ${dhipStart} ${dhipEnd}; #地址池
|
||||
option routers ${dhip}; # 网关地址
|
||||
ddns-update-style none; # 禁止ddns动态更新
|
||||
next-server ${dhip}; # 服务器地址
|
||||
filename "pxelinux.0"; # 指定pxe引导文件
|
||||
default-lease-time 600;
|
||||
max-lease-time 7200;
|
||||
}
|
||||
EOF
|
||||
# 拷贝引导程序
|
||||
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
|
||||
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
|
||||
|
||||
# 配置引导文件
|
||||
cat > /var/lib/tftpboot/pxelinux.cfg/default << EOF
|
||||
#UI menu.c32
|
||||
default centos7 local
|
||||
prompt 1
|
||||
timeout 5
|
||||
label centos7 local
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img method=ftp://${dhip}/centos7
|
||||
label centos7 net
|
||||
kernel vmlinuz
|
||||
append initrd=initrd.img method=${centos7_iso} # ks=ftp
|
||||
EOF
|
||||
# 设置开机自启,并重新启动
|
||||
systemctl enable --now tftp vsftpd dhcpd xinetd
|
||||
systemctl restart tftp vsftpd dhcpd xinetd
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo 'pxe引导服务搭建成功!'
|
||||
fi
|
||||
```
|
||||
|
||||
## 无人值守引导配置
|
||||
```sh
|
||||
#platform=x86, AMD64, 或 Intel EM64T
|
||||
#version=DEVEL
|
||||
# Install OS instead of upgrade
|
||||
install
|
||||
# Keyboard layouts
|
||||
keyboard 'us'
|
||||
# Root password
|
||||
rootpw --iscrypted $1$RrxYwvA3$RQQcS4Mas0Ef.TqS0Ptot/
|
||||
# System language
|
||||
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# Use text mode install
|
||||
text
|
||||
# SELinux configuration
|
||||
selinux --disabled
|
||||
# Do not configure the X Window System
|
||||
skipx
|
||||
|
||||
|
||||
# Firewall configuration
|
||||
firewall --disabled
|
||||
# Network information
|
||||
network --bootproto=dhcp --device=eth0
|
||||
# Reboot after installation
|
||||
reboot
|
||||
# System timezone
|
||||
timezone Asia/Shanghai
|
||||
# Use network installation
|
||||
url --url="http://https://repo.huaweicloud.com/centos/7.9.2009/os/x86_64/"
|
||||
# url --url=ftp://<user>:<password>@<server>/<path>
|
||||
|
||||
#platform=x86, AMD64, 或 Intel EM64T
|
||||
#version=DEVEL
|
||||
# Install OS instead of upgrade
|
||||
install
|
||||
# Keyboard layouts
|
||||
keyboard 'us'
|
||||
# Root password
|
||||
rootpw --iscrypted $1$RrxYwvA3$RQQcS4Mas0Ef.TqS0Ptot/
|
||||
# System language
|
||||
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8
|
||||
# System authorization information
|
||||
auth --useshadow --passalgo=sha512
|
||||
# Use text mode install
|
||||
text
|
||||
# SELinux configuration
|
||||
selinux --disabled
|
||||
# Do not configure the X Window System
|
||||
skipx
|
||||
|
||||
|
||||
# Firewall configuration
|
||||
firewall --disabled
|
||||
# Network information
|
||||
network --bootproto=dhcp --device=eth0
|
||||
# Reboot after installation
|
||||
reboot
|
||||
# System timezone
|
||||
timezone Asia/Shanghai
|
||||
# Use network installation
|
||||
#url="http://https://repo.huaweicloud.com/centos/7.9.2009/os/x86_64/"
|
||||
url --url=ftp://192.168.225.133/centos7
|
||||
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
# Partition clearing information
|
||||
ignoredisk --only-use=sda
|
||||
clearpart --all --initlabel
|
||||
# Disk partitioning information
|
||||
part /boot --fstype="xfs" --asprimary --size=2048
|
||||
part / --fstype="xfs" --grow --asprimary --size=1
|
||||
|
||||
services --enabled="sshd,network"
|
||||
|
||||
# 安装软件包
|
||||
%packages
|
||||
network-tools
|
||||
openssh
|
||||
openssl-devel
|
||||
wget
|
||||
|
||||
%end
|
||||
|
||||
# 系统安装前运行程序
|
||||
%pre --interpreter=/bin/bash
|
||||
echo 'centos7 install'
|
||||
%end
|
||||
|
||||
# 系统安装后运行程序
|
||||
%post --interpreter=/bin/bash
|
||||
|
||||
wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-
|
||||
reg.repo
|
||||
%end
|
||||
|
||||
```
|
||||
299
软件or平台使用/ensp配置.md
Normal file
299
软件or平台使用/ensp配置.md
Normal file
@@ -0,0 +1,299 @@
|
||||
### 用户模式命令
|
||||
|
||||
***
|
||||
|
||||
clock timezone 时区名字 add 当地时区时间 #设置系统时区
|
||||
|
||||
clock datatime 08:00:00 2021-04-19 #设置系统时间
|
||||
|
||||
reset saved-configuration #清空配置文件
|
||||
|
||||
display current-configuration #显示系统配置
|
||||
|
||||
startup system-software 文件名 #使用新的vrp系统文件启动
|
||||
|
||||
BOOTROM菜单默认密码huawei,高版本Admin@huawei
|
||||
|
||||
reset recycle-bin #清空回收站文件
|
||||
|
||||
display saved-configuration #查看保存的配置文件
|
||||
|
||||
display startup #查看下次启动使用的配置文件
|
||||
|
||||
save #保存配置
|
||||
|
||||
### 系统模式命令 "system"
|
||||
|
||||
sysname 名字 #给设备重命名
|
||||
|
||||
header shell information "内容" #设置登录内容
|
||||
|
||||
display ip routing-table #查看路由表
|
||||
|
||||
telnet server port 端口号 #设置Telnet远程端口号
|
||||
|
||||
### 接口模式命令 "interface 接口"
|
||||
|
||||
***
|
||||
|
||||
undo portswitch #将二层口切换到三层口
|
||||
### 同时配置多个端口
|
||||
int range G0/0/1 to G0/0/5
|
||||
|
||||
> 华为设备只有三层口可以直接配置IP,二层只能通过vlan,低级设备只有wan口是三层
|
||||
|
||||
undo shutdown #启用接口
|
||||
|
||||
shutdown #关闭接口
|
||||
|
||||
display this #显示接口配置
|
||||
|
||||
description 内容 #设置接口的描述信息
|
||||
|
||||
ip address IP地址 掩码 sub #环回接口下,配置子地址
|
||||
|
||||
### 用户界面模式命令 "user-interface 接口"
|
||||
|
||||
***
|
||||
|
||||
authentication-mode 验证方式 #设置登录方式为password,aaa,空
|
||||
|
||||
idle-timeout N分钟 #用户接口模式下,设置登录超时时间,0为永不超时,等同于undo idle-timeout
|
||||
|
||||
set authentication password cipher 密码 #设置登录密码
|
||||
|
||||
user privilege level 级别 #为接口设置用户级别
|
||||
|
||||
> 用户级别:0参观级;1监控级;2配置级;3-15管理级命令级别:0参观级;0、1监控级;0/1/2配置级;0/1/2/3管理级
|
||||
|
||||
### 路由协议模式命令
|
||||
|
||||
***
|
||||
|
||||
### VLAN模式命令
|
||||
批量创建vlan
|
||||
vlan batch 10 20 30
|
||||
|
||||
***
|
||||
|
||||
### 通用模式命令(在所有模式都可使用)
|
||||
|
||||
display ip interface brief #查看端口配置信息
|
||||
|
||||
### STP(生成树协议)命令
|
||||
|
||||
***
|
||||
|
||||
stp enable #开启stp协议
|
||||
|
||||
stp mode stp #切换stp协议,华为默认为mstp协议
|
||||
|
||||
stp root primary #设置主要根桥
|
||||
|
||||
stp root secondary #设置次要根桥
|
||||
|
||||
undo stp root #设置根桥
|
||||
|
||||
stp priority 数字 #设置根桥优先级,数字越小级别越高
|
||||
|
||||
undo stp priority #恢复stp缺省优先级
|
||||
|
||||
stp port priority 数字 #在接口模式下,设置端口优先级,数字越小优先级越高
|
||||
|
||||
undo stp port priority #在接口模式下,恢复端口缺省优先级
|
||||
|
||||
stp cost 数字 #在接口模式下,修改端口的开销值
|
||||
|
||||
undo stp cost #在接口模式下,恢复端口缺省开销值
|
||||
|
||||
display stp #查看根桥信息
|
||||
|
||||
display stp brief #查看stp接口信息
|
||||
|
||||
### RSTP(快速生成树协议)命令
|
||||
|
||||
***
|
||||
|
||||
stp edged-port enable #在接口模式下,配置端口为边缘端口
|
||||
|
||||
stp bpdu-protection #配置bpdu保护功能
|
||||
|
||||
stp loop-protection #在非根桥交换机的根端口和Alternate口配置环路保护功能
|
||||
|
||||
### 静态路由
|
||||
|
||||
***
|
||||
|
||||
ip route-static 目的网络 子网掩码 下一跳ip #系统模式下,配置静态路由,需双向配置
|
||||
|
||||
ip route-static 目的网络 子网掩码 下一跳ip preference 80 #系统模式下,通过降低优先级,配置备份静态路由,缺省优先级为60
|
||||
|
||||
undo ip route-static 目的网络 子网掩码 下一跳ip preference 80 #系统模式下,删除此静态路由
|
||||
|
||||
ip route-static 0.0.0.0 0 下一跳ip preference 80 #配置备份缺省路由,双向配置
|
||||
|
||||
### RIP(距离矢量型路由协议)
|
||||
|
||||
***
|
||||
|
||||
interface LoopBack 数字 #系统模式下,进入虚拟环回接口,需要配置IP
|
||||
|
||||
ip address ip地址 掩码 sub #在环回接口下,配置子环回地址
|
||||
|
||||
rip 进程号 #系统模式下,进入rip协议,进程号默认为1,删除rip进程,在命令前加undo
|
||||
|
||||
version 2 #在rip协议下,使用RIP协议版本2
|
||||
|
||||
rip summary-address 网络地址 子网掩码 #在接口模式下,配置路由汇总,减小路由表
|
||||
|
||||
undo summary #接口模式下,取消RIP协议自动汇总
|
||||
|
||||
network 直连网络 #rip协议模式下,通告本路由的直连网络,输入网络地址,如:10.0.0.0
|
||||
|
||||
reset ip routing-table statistics protocol rip #清除错误的RIP路由信息
|
||||
|
||||
display ip routing-table protocol rip #查看RIP协议的路由表
|
||||
|
||||
silent-interface 端口 #在rip协议下,使端口进入沉默模式,只接受其他路由发送的通告,不向其他路由发送通告,解除方式在命令前加undo
|
||||
|
||||
rip authentication-mode simple 密码 #在接口模式下,配置rip明文认证,相连的两个接口要设置同一认证方式
|
||||
|
||||
rip authentication-mode md5 usual 密码 #在接口模式下,配置rip的MD5认证
|
||||
|
||||
undo rip authentication-mode #删除rip认证配置
|
||||
|
||||
rip version 1 #接口模式下,对使用rip2协议的路由同时兼容rip1协议
|
||||
|
||||
debugging rip 1 #用户模式下,开启RIP调试功能
|
||||
|
||||
> display debugging #用户模式下,显示当前调试信息terminal debugging #用户模式下,将debug信息在终端显示undo debugging rip 进程号 #用户模式下,关闭debug调试,undo debugging all #关闭调试功能debugging rip 1 event #用户模式下,查看路由器发出和收到的定期更新事件"过多开起debug命令,会大量占用路由器资源,甚至导致宕机"
|
||||
|
||||
### OSPF(开放式最短路径优先协议"ospf属于链路状态型路由协议")
|
||||
|
||||
***
|
||||
|
||||
ospf 进程号 router-id 路由器ID(环回地址) #系统模式下,进入ospf配置模式,进程号默认为1,进程号只有本地意义.
|
||||
|
||||
area 区域号(数字) #ospf协议模式下.进入区域配置视图
|
||||
|
||||
network 10.1.1.1 反掩码 #区域配置模式下,通告设备接口的网络,反掩码将正掩码取反(255.255.255.0的反掩码就是0.0.0.255),取消单个通告在命令前加undo
|
||||
|
||||
authentication-mode md5 1 cipher 密码 #区域配置模式下,设置ospf协议的md5认证
|
||||
|
||||
display ip routing-table protocol ospf #查看ospf协议的路由表
|
||||
|
||||
display ospf brief #查看ospf配置的具体信息
|
||||
|
||||
display ospf peer brief #查看ospf的邻居关系
|
||||
|
||||
display ospf lsdb #查看LSA信息的链路状态数据库
|
||||
|
||||
display ospf interface 端口 #查看ospf的hello和dead时间
|
||||
|
||||
ospf cost 数字 #接口模式下,调整接口的开销值
|
||||
|
||||
bandwidth-reference 数字 #ospf协议模式下,修改带宽值(可以影响开销值),数字为10的整数倍,所有路由都要配置相同带宽值
|
||||
|
||||
silent-interface 接口 #在路由协议模式下,配置被动接口,既不接受路由信息,也不发送路由信息,通常配置在连接终端设备的接口
|
||||
|
||||
ospf timer hello 数字 #接口模式下,调整hello的值,调整hello和dead的值可以影响ospf路由建立邻居关系
|
||||
|
||||
ospf timer dead 数字 #接口模式下,调整dead的值
|
||||
|
||||
preference 数字 #ospf协议下,修改ospf路由优先级
|
||||
|
||||
preference ase 数字 #ospf协议下,修改ospf外部导入路由优先级
|
||||
|
||||
ospf dr-priority 数字 #接口模式下,修改路由的DR值,改变路由的优先级,默认情况下DR/BDR通过非抢占式选举,修改后需要重置ospf的邻居关系才会生效,例如:关闭某个端口,在打开.
|
||||
|
||||
import-route 路由类型 #ospf协议模式下,导入外部路由,direct为直连路由
|
||||
|
||||
ospf enable 进程号 area 区域号 #接口模式下,将接口地址宣告到对应的区域
|
||||
|
||||
> 多区域ospf配置OSPF虚链路配置
|
||||
|
||||
abr-summary 路由汇总后地址 汇总后掩码 #ospf区域模式下,配置路由汇总,适用于边界路由
|
||||
|
||||
asbr-summary 路由汇总后地址 汇总后掩码 #ospf协议模式下,配置路由汇总,适用于自治 边界路由
|
||||
|
||||
default-route-advertise always #ospf协议下,配置默认路由
|
||||
|
||||
ospf配置缺省路由并发布
|
||||
|
||||
> ip route-static 0.0.0.0 0.0.0.0 LoopBack 1 #系统模式下,配置缺省路由default-route-advertise #在ospf协议下,发布缺省路由到ospf域
|
||||
|
||||
### DHCP服务配置
|
||||
|
||||
***
|
||||
|
||||
dhcp enable #系统模式下,开启DHCP服务
|
||||
|
||||
ip pool name #系统模式下,创建名为name的地址池,并进入dhcp配置模式
|
||||
|
||||
network IP起始范围 mask 24 #dhcp模式下,设置地址池及子网掩码
|
||||
|
||||
gateway-list 网关IP #dhcp模式下,配置网关地址
|
||||
|
||||
excluded-ip-address 起始地址 终止地址 #DHCP模式下,设置不分配的IP
|
||||
|
||||
lease day 0 hour 8 #dhcp模式下,设置dhcp租期为0天8小时
|
||||
|
||||
dhcp select global #接口模式下,设置dhcp为全局范围,interface为接口,relay为中继
|
||||
|
||||
dhcp select interface #接口模式下,开启接口的dhcp功能
|
||||
|
||||
display ip pool name 地址池名称 #查看地址池的参数
|
||||
|
||||
> 交换机DHCP配置dhcp enable #系统模式下,启用dhcp功能interface Vlanif 1 #系统模式下,进入缺省管理端口ip address dhcp-alloc #缺省管理接口下,向dhcp服务器申请IP地址display ip interface brief #查看接口信息
|
||||
|
||||
### 3A认证用户创建及配置
|
||||
|
||||
***
|
||||
|
||||
aaa #系统模式,进入3A认证
|
||||
|
||||
local-user 用户名 password cipher 密码 #3A模式下,创建本地用户名和密码
|
||||
|
||||
local-user 用户名 service-type ftp #3A模式下,设置用户为ftp用户,或ssh用户
|
||||
|
||||
local-user 用户名 privilege level 级别(1-15) #3A模式想,设置用户级别
|
||||
|
||||
local-user 用户名 ftp-directory 目录 #3A模式下,设置用户目录
|
||||
|
||||
local-user 用户名 idle-timeout 时间 #3A模式下,设置ftp终端登录超时时间
|
||||
|
||||
### FTP服务配置
|
||||
|
||||
***
|
||||
|
||||
ftp server enable #系统模式下,启动ftp功能
|
||||
|
||||
set default ftp-directory 目录 #系统模式下,设置ftp服务目录
|
||||
|
||||
display ftp-server #显示ftp服务器信息
|
||||
|
||||
binary #ftp客户端下,配置文件传输模式
|
||||
|
||||
创建用户参考3A创建用户
|
||||
|
||||
get 文件名 #客户端下,从服务器下载文件,可一次输入多个文件名用空格隔开
|
||||
|
||||
put 文件名 #客户端下,上传文件到服务器
|
||||
|
||||
bye #ftp客户端下,关闭ftp连接
|
||||
|
||||
### SSH配置
|
||||
|
||||
***
|
||||
|
||||
rsa local-key-pair create #系统模式下,创建秘钥,选择秘钥长度
|
||||
|
||||
stelnet server enable #系统模式下,启动SSH服务器
|
||||
|
||||
user-interface vty 0 #系统模式下,进入vty接口
|
||||
|
||||
authentication-mode aaa #vty接口下,指定认证方式为3A
|
||||
|
||||
protocol inbound ssh #vty接口下,指明入站协议为ssh
|
||||
|
||||
ssh user 用户名 authentication-type password #将ssh协议与用户和密码关联起来,创建用户参考3A创建用户
|
||||
192
软件or平台使用/华三设备配置.md
Normal file
192
软件or平台使用/华三设备配置.md
Normal file
@@ -0,0 +1,192 @@
|
||||
# 端口及配置文件说明
|
||||
```
|
||||
# 交换机端口
|
||||
tg1/0/49 10G端口
|
||||
fg1/0/53 40G端口
|
||||
mg1/0/0 10-1000M自适应管理端口
|
||||
|
||||
#路由器端口
|
||||
g0/0/1
|
||||
|
||||
#查看接口信息
|
||||
[H3C]dis interface Vlan-interface 1 brief
|
||||
[H3C]dis interface g1/0/1 brief
|
||||
|
||||
#查看当前生效配置
|
||||
<H3C> display current-configuration
|
||||
#查看下次启动使用的配置文件
|
||||
<H3C> display saved-configuration
|
||||
#查看最近配置变化
|
||||
<H3C> display configuration changes
|
||||
# 查看系统时间
|
||||
<H3C> display clock
|
||||
```
|
||||
# 远程超时时间配置
|
||||
```
|
||||
#设置cli或vty连接超时时间600分钟
|
||||
<H3C>sys
|
||||
[H3C]user-interface vty 0 4
|
||||
[H3C-line-vty0-4]idle-timeout 600
|
||||
[H3C-line-vty0-4]quit
|
||||
|
||||
#设置ssh和telnet超时时间600分钟
|
||||
<H3C>sys
|
||||
[H3C]user-interface vty 0 4
|
||||
[H3C-line-vty0-4]protocol inbound telnet
|
||||
[H3C-line-vty0-4]idle-timeout 600
|
||||
[H3C-line-vty0-4]protocol inbound ssh
|
||||
[H3C-line-vty0-4]idle-timeout 600
|
||||
[H3C-line-vty0-4]quit
|
||||
|
||||
#设置console接口超时时间600分钟
|
||||
<H3C>sys
|
||||
[H3C]user-interface console 0
|
||||
[H3C-line-console0]idle-timeout 600
|
||||
[H3C-line-console0]quit
|
||||
|
||||
```
|
||||
# 堆叠交换机
|
||||
```
|
||||
sys
|
||||
int range FortyGigE 1/0/53 to FortyGigE 1/0/54 #进入堆叠端口
|
||||
shutdown #关闭端口
|
||||
irf member 1 priority 32 #配置优先级
|
||||
irf-port 1/1 #配置irf端口
|
||||
irf-port-configuration active #激活irf端口配置
|
||||
irf-port 1/1 #配置irf端口
|
||||
port group interface FortyGigE 1/0/53
|
||||
port group interface FortyGigE 1/0/54
|
||||
quit
|
||||
|
||||
dis irf #显示irf相关信息
|
||||
dis irf link #显示irf链路信息
|
||||
dis irf conf #显示irf重启后生效的irf配置
|
||||
```
|
||||
# 端口聚合
|
||||
```
|
||||
sys
|
||||
[H3C]int bridge-agg 1
|
||||
link-aggregation mode dynamic # 切换为动态速率模式
|
||||
quit
|
||||
int range g1/0/1 to g1/0/4
|
||||
port link-aggregation group 1 将端口加入聚合组
|
||||
|
||||
display link-aggregation verbose # 查看端口聚合信息
|
||||
```
|
||||
# 二三层口切换
|
||||
```
|
||||
sys
|
||||
[H3C]int GigabitEthernet1/0/48
|
||||
[H3C-GigabitEthernet1/0/48]port link-mode { bridge | route } #bridge是二层,route是三层
|
||||
```
|
||||
# vlan配置
|
||||
```
|
||||
[H3C]vlan 253 #创建vlan253
|
||||
[H3C-vlan253]port GigabitEthernet 1/0/48 #在vlan模式下将端口加入vlan253
|
||||
[H3C-GigabitEthernet1/0/48]port access vlan 253 #在接口模式下将端口加入vlan
|
||||
[H3C-GigabitEthernet1/0/48]port link-type trunk #配置接口为trunk类型
|
||||
[H3C-GigabitEthernet1/0/48]port trunk permit vlan all #允许所有vlan通过
|
||||
[H3C-GigabitEthernet1/0/48]port trunk permit vlan 10 20 #允许指定vlan通过
|
||||
|
||||
[H3C]dis interface Vlan-interface brief #查看所有vlanif接口配置
|
||||
[H3C]dis vlan #显示所有打开的vlan
|
||||
|
||||
```
|
||||
# dhcp服务
|
||||
```
|
||||
[H3C]dhcp enable
|
||||
[H3C]dhcp server ip-pool manage #创建名为mange的ip地址池
|
||||
[H3C-dhcp-pool-manage]network 10.0.1.0 24 #设置地址池
|
||||
[H3C-dhcp-pool-manage]forbidden-ip 10.0.1.1 10.0.1.254 #设置保留ip
|
||||
[H3C-dhcp-pool-manage]gateway-list 10.0.1.254 #分配dhcp网关
|
||||
[H3C-dhcp-pool-manage]dns-list 223.5.5.5 #分配dns地址
|
||||
[H3C-dhcp-pool-manage]quit
|
||||
[H3C]int vlan 1 #进入对应的vlanif接口
|
||||
[H3C-Vlan-interface1]ip address 10.0.1.254 24 #设置ip地址
|
||||
|
||||
# 配置dhcp中继,只能在vlanif接口下配置
|
||||
[H3C]int vlan 1 #进入vlan1
|
||||
[H3C-Vlan-interface1]dhcp select relay
|
||||
[H3C-Vlan-interface1]ip address 10.0.1.1 24 #设置ip地址
|
||||
|
||||
[H3C]quit
|
||||
|
||||
[H3C]display dhcp server pool ip池名字 #查看dhcp池1配置信息
|
||||
[H3C]display dhcp relay #查看dhcp中继配置
|
||||
<H3C> display dhcp server lease #查看dhcp租约
|
||||
|
||||
```
|
||||
|
||||
# stp生成树
|
||||
```
|
||||
stp模式有stp,rstp,pstp,mstp
|
||||
[H3C]stp mode mstp #配置stp模式
|
||||
|
||||
[H3C]dis stp root #显示生成树根桥信息
|
||||
|
||||
|
||||
```
|
||||
# 静态路由
|
||||
```
|
||||
<H3C>sys
|
||||
[H3C]ip route-static 目的ip 子网掩码 下一跳ip #添加一条静态路由
|
||||
[H3C]delete static-routes all #删除所有静态路由
|
||||
[H3C]undo ip route-static 目的ip #删除一条静态路由
|
||||
[H3C]ip route-static fast-reroute auto #配置静态路由快速重路由
|
||||
# 配置静态路由快速重路由支持BFD检测功能
|
||||
[H3C]bfd echo-source-ip 自定义ip #配置echo报文源ip
|
||||
[H3C]ip route-static primary-path-detect bfd echo #使能静态路由中主用链路的BFD(Echo方式)检测功能
|
||||
|
||||
[H3C]dis ip routing-table protocol static verbose #查看静态路由表信息
|
||||
[H3C]dis ip routing-table protocol direct #查看直连路由信息表
|
||||
|
||||
# window添加静态路由
|
||||
[H3C]route add -p 192.168.2.0 mask 255.255.255.0 192.168.1.1 metric 1 #-p代表永久,metric表示路由跃点数
|
||||
[H3C]route delete [目的ip] #删除静态路由
|
||||
```
|
||||
|
||||
# VRRP协议
|
||||
```
|
||||
# 三层接口创建vrrp
|
||||
[H3C]int g1/0/48 #进入三层接口
|
||||
[H3C-GigabitEthernet1/0/48]vrrp vrid 1 virtual-ip 10.10.0.1 #创建备份组1,并配置虚拟ip
|
||||
|
||||
# 二层接口通过vlanif创建vrrp
|
||||
[H3C]vlan 10 #创建vlan10
|
||||
[H3C]quit
|
||||
[H3C]int vlan 10 #进入vlanif10接口
|
||||
[H1-Vlan-interface10]vrrp vrid 1 virtual-ip 10.10.10.1 #创建备份组
|
||||
|
||||
# 其他配置
|
||||
[H1-Vlan-interface10]vrrp vrid 1 priority 150 #设置备份组优先级,值越大优先级越高
|
||||
|
||||
|
||||
```
|
||||
# OSPF协议
|
||||
```
|
||||
<hx1-1>sys
|
||||
[hx1-1]ospf 1 router-id 1.1.1.1 #打开ospf进程1,设置routerid为1.1.1.1
|
||||
[hx1-1-ospf-1]area 0 # 进入区域0
|
||||
[hx1-1-ospf-1-area-0.0.0.0]network 10.1.0.0 0.0.3.255 #添加设备下的网络,采用反掩码
|
||||
[hx1-1-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain 123456 #设置ospf明文认证密码
|
||||
[hx1-1-ospf-1-area-0.0.0.0]dis ospf peer #查看ospf的邻居关系
|
||||
[hx1-1-ospf-1]preference 1 #修改路由优先级
|
||||
|
||||
|
||||
[H3C]dis ospf interface #查看ospf接口信息
|
||||
[H3C]dis ospf routing #查看ospf路由表信息
|
||||
[H3C]dis ospf peer statistics #显示本地路由器所有ospf邻居统计信息
|
||||
[H3C]undo ospf 进程号 #关闭ospf
|
||||
```
|
||||
|
||||
# 命令大全
|
||||
## ping
|
||||
```
|
||||
-c 指定ping次数
|
||||
-a 指定源IP地址
|
||||
-f 指定不分段的数据包
|
||||
-h 指定TTL值
|
||||
-i 指定传出接口
|
||||
-m 指定发送回显请求的间隔,单位:毫秒
|
||||
-n 仅数字输出。不会尝试查找主机
|
||||
```
|
||||
150
软件or平台使用/软件快捷键.md
Normal file
150
软件or平台使用/软件快捷键.md
Normal file
@@ -0,0 +1,150 @@
|
||||
## VS Code快捷命令
|
||||
|
||||
**1. 光标选取操作**
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>↑/↓</kbd>
|
||||
多光标选择
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>L</kbd>
|
||||
附加光标到当前选择的实例
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>D</kbd>
|
||||
单次增加光标选择
|
||||
|
||||
<kbd>Shift</kbd> + <kbd>Alt</kbd>
|
||||
列框选择
|
||||
|
||||
<kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>←/→</kbd>
|
||||
缩小/扩大选择
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>U</kbd>
|
||||
减少光标选区
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>L</kbd>
|
||||
选择当前行
|
||||
|
||||
**2. 菜单快捷命令**
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>
|
||||
打开命令面板
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>P</kbd>
|
||||
快速打开文件
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>R</kbd>
|
||||
快速打开最近文件
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>👆</kbd>
|
||||
创建或打开文件
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>F4</kbd>
|
||||
关闭当前打开的文件夹
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>B</kbd>
|
||||
打开关闭边栏
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>J</kbd>
|
||||
打开控制台
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Z</kbd>
|
||||
全屏模式(按两次Esc退出)
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Tab</kbd>
|
||||
浏览历史记录
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Ctrl</kbd> + <kbd>T</kbd>
|
||||
修改主题
|
||||
|
||||
**3. 编辑快捷命令**
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>\</kbd>
|
||||
并排编辑
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>1/2/3</kbd>
|
||||
多窗口下切换
|
||||
|
||||
<kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>↑/↓</kbd>
|
||||
上下文复制
|
||||
|
||||
<kbd>Alt</kbd> + <kbd>Up/Down</kbd> 或 <kbd>Alt</kbd> + <kbd>↑/↓</kbd>
|
||||
上下移动行
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd>
|
||||
转到文件中的符号
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>T</kbd>
|
||||
转到工作区中的符号
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Ctrl</kbd> + <kbd>X</kbd>
|
||||
删除末尾空白
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>G</kbd>
|
||||
导航到指定行
|
||||
|
||||
>transform
|
||||
|
||||
将选区文本转换为大小写或标题
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>M</kbd>
|
||||
|
||||
更改语言模式
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>M</kbd>
|
||||
|
||||
快速跳转到错误位置
|
||||
|
||||
<kbd>F8</kbd> 或 <kbd>Shift</kbd> + <kbd>F8</kbd>
|
||||
|
||||
循环检查错误
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Ctrl</kbd> + <kbd>F</kbd>
|
||||
|
||||
代码格式化当前选区
|
||||
|
||||
<kbd>Shift</kbd> + <kbd>Alt</kbd> + <kbd>F</kbd>
|
||||
|
||||
代码格式化整个文档
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>[ ]</kbd>
|
||||
|
||||
当前代码块折叠
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Ctrl</kbd> + <kbd>0</kbd>
|
||||
|
||||
全部折叠
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Ctrl</kbd> + <kbd>J</kbd>
|
||||
|
||||
全部展开
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>Ctrl</kbd> + <kbd>/</kbd>
|
||||
|
||||
折叠所有注释
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Home/End</kbd>
|
||||
|
||||
导航到文件开头或结尾
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd>
|
||||
|
||||
打开Markdown预览
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>K</kbd> <kbd>V</kbd>
|
||||
|
||||
并排Markdown编辑和预览
|
||||
|
||||
<kbd>Ctrl</kbd> + <kbd>空格</kbd>
|
||||
|
||||
智能感知(触发建议小部件)窥视
|
||||
|
||||
选择一个符号 <kbd>Alt</kbd> + <kbd>F12</kbd>
|
||||
|
||||
转到定义
|
||||
|
||||
选择一个符号 <kbd>F12</kbd>
|
||||
|
||||
返回先前位置 <kbd>Alt</kbd> + <kbd>Left</kbd> 或使用命令 Go > <kbd>删除</kbd>
|
||||
|
||||
前往参考
|
||||
|
||||
选择一个符号 <kbd>Shift</kbd> + <kbd>F12</kbd>
|
||||
Reference in New Issue
Block a user