Sonic_cli常用命令
用户名:admin
密码:YourPaSsWoRd
//change password
1>admin@sonic:~$ passwd
Changing password for admin.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
2>
echo USER:$(LANG=C perl -e 'print crypt("PASSWORD", "salt"),"\n"') | sudo chpasswd -e
(USER:username,PASSWORD:password)
//no shutdown
root@sonic:/home/admin# config interface startup Ethernet0
//shutdown
root@sonic:/home/admin# config interface shutdown Ethernet0
//port link status
root@sonic:/home/admin# show interfaces status Ethernet0
//interface speed
root@sonic:/home/admin#config interface speed Ethernet0 10000
//check system eeprom
root@sonic:/home/admin# show platform syseeprom
Command: sudo decode-syseeprom
//check sensor info
root@sonic:/home/admin# sensors
//check version info
root@sonic:/home/admin# show version
//vlan config
root@sonic:/home/admin# config vlan add 4
//vlan port tagged/untagged
root@sonic:/home/admin# config vlan member add 4 Ethernet6
root@sonic:/home/admin# config vlan member add 4 Ethernet7 -u
// show vlan
root@sonic:/home/admin# show vlan config
//check PSU status
root@sonic:/home/admin# show platform psustatus
//check capebility
crm show thresholds all
//check current config
show runningconfiguration interfaces
//check transceivers
show interfaces transceiver eeprom --dom Ethernet0
root@sonic:/home/admin# show interfaces transceiver lpmode Ethernet1
root@sonic:/home/admin# sfputil show lpmode --port Ethernet0
root@sonic:/home/admin# show interfaces transceiver presence Ethernet0
//check port statistics
root@sonic:/home/admin# show interfaces transceiver presence Ethernet0
//enter bcmshell
root@sonic:/home/admin# bcmcmd "ps "
//show ip route
root@sonic:/home/admin# ip route show
//show port statistic
root@sonic:/home/admin# ip -s link
root@sonic:/home/admin# ip -s link ls Ethernet1
//set ip address
root@sonic:/home/admin# ip addr add 192.168.0.24/24 dev Ethernet2
//show ip address
root@sonic:/home/admin# ip addr show dev Ethernet2
//check sysmlog
show logging |more
//show psu status
root@sonic:/home/admin# psuutil status
//show transceiver eeprom
sfputil show eeprom
//show tranceiver present
root@sonic:/home/admin# sfputil show presence --port Ethernet0
root@sonic:/home/admin# sfputil show presence
//enable lpmode
root@sonic:/home/admin# sfputil lpmode on Ethernet1
//clear mac table
sonic-clear fdb all
//show mac table
root@sonic:/home/admin#fdbshow
root@sonic:/home/admin# show mac
>>how to create LAG portchannel using minigraph.xml file
1.root@sonic:/home/admin# vi /etc/sonic/minigraph.xml
<PortChannelInterfaces>
<PortChannel>
<Name>PortChannel01</Name>
<AttachTo>Ethernet112,Ethernet126</AttachTo>
<SubInterface/>
</PortChannel>
<PortChannel>
<Name>PortChannel03</Name>
<AttachTo>Ethernet116</AttachTo>
<SubInterface/>
</PortChannel>
</PortChannelInterfaces>
2.config save
3.show interface portchannel
root@sonic:/home/admin# show interfaces portchannel
Command: teamshow
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available, S - selected, D - deselected
No. Team Dev Protocol Ports
----- ------------- ----------- -------
01 PortChannel01 LACP(A)(Dw) N/A
03 PortChannel03 LACP(A)(Dw) N/A
root@sonic:/home/admin#
>>How to configuration using .json file
1.create a .json file
2.edit .json file
3.config load .json
example:
{
"VLAN": {
"vlan100": {
"vlanid": 100
},
"vlan200": {
"vlanid": 200
}
},
"VLAN_MEMBER": {
"vlan100|Ethernet1": {
"tagging_mode": "untagged"
},
"vlan200|Ethernet2": {
"tagging_mode": "tagged"
}
}
}
4.show vlan config
Sonic_cli常用命令的更多相关文章
- Linux 常用命令(持续补充)
常用命令: command &:将进程放在后台执行 ctrl + z:暂停当前进程 并放入后台 jobs:查看当前后台任务 bg( %id):将任务转为后台执行 fg( %id):将任务调回前 ...
- LVM基本介绍与常用命令
一.LVM介绍LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制LVM - 优点:LVM通常用于装备大量磁盘的系统,但它同样适 ...
- Linux学习笔记(一):常用命令
经过统计Linux中能够识别的命令超过3000种,当然常用的命令就远远没有这么多了,按照我的习惯,我把已经学过的Linux常用命令做了以下几个方面的分割: 1.文件处理命令 2.文件搜索命令 3.帮助 ...
- git常用命令(持续更新中)
git常用命令(持续更新中) 本地仓库操作git int 初始化本地仓库git add . ...
- 【原】npm 常用命令详解
今年上半年在学习gulp的使用,对npm的掌握是必不可少的,经常到npm官网查询文档让我感到不爽,还不如整理了一些常用的命令到自己博客上,于是根据自己的理解简单翻译过来,终于有点输出,想学习npm这块 ...
- npm常用命令
npm常用命令 环境:win7 npm 是什么 NPM(node package manager),通常称为node包管理器.顾名思义,它的主要功能就是管理node包,包括:安装.卸载.更新.查看.搜 ...
- Git 常用命令
一.初始環境配置 git config --global user.name "John Doe"git config --global user.email johndoe@ex ...
- linux iptables常用命令之配置生产环境iptables及优化
在了解iptables的详细原理之前,我们先来看下如何使用iptables,以终为始,有可能会让你对iptables了解更深 所以接下来我们以配置一个生产环境下的iptables为例来讲讲它的常用命令 ...
- Linux常用命令(一)
Linux常用命令 1. pwd查看当前路径(Print Working Directory) [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...
随机推荐
- mybatis用mysql数据库自增主键,插入一条记录返回新增记录的自增主键ID
今天在敲代码的时候遇到一个问题,就是往数据库里插入一条记录后需要返回这个新增记录的ID(自增主键), 公司框架用的是mybatis的通用Mapper接口,里面的插入方法貌似是不能把新纪录的ID回填到对 ...
- 用vscode写c/c++
用vscode写c/c++ 1. 安装wsl windows下安装linux(ubuntu) 2. 打开设置 3. 输入run code 随便找一个地方粘贴,会出现一大段代码 4. 把c对应的代码修改 ...
- springboot 注解@EnableConfigurationProperties @ConfigurationProperties作用
@EnableConfigurationProperties 在springboot启动类添加,当springboot程序启动时会立即加载@EnableConfigurationProperties注 ...
- java截取小数点后两位
String a = "123.3445776";int i = a.indexOf(".");System.out.println(a.substring(0 ...
- 吴裕雄 PYTHON 人工智能——基于MASK_RCNN目标检测(5)
import os import sys import numpy as np import tensorflow as tf import matplotlib import matplotlib. ...
- Abaqus 粘聚力模型(Cohesive Model)
目录 1. 问题描述 2. 有限元模型建立--Cohesive单元 3. 有限元模型建立--接触方法 Abaqus提供了两种方法模拟胶结特性: 使用Cohesive单元模拟胶结,通过定义材料属性和截面 ...
- 浅析PHP页面局部刷新功能的实现小结(转)
转载地址 https://www.jb51.net/article/38901.htm 方法其实挺多的.以前比较常用的是iframe这样来做.现在多了个ajax,所以一般情况下都是用的ajax.第一种 ...
- 克隆虚拟机后ip配置
(1)出错原因: 错误:No suitable device found: no device found for connection "System eth0" 原因:克隆虚拟 ...
- 【Struts 编码】
EncodingFilter package k.filter; import javax.servlet.*; import javax.servlet.http.HttpServlet; impo ...
- PL2303HXA自2012已停产
解决"PL2303HXA自2012已停产,请联系供货商" USB不识别的问题: 问题是WIN10自带的驱动不兼容引起的,只能安装早期驱动,再驱动程序中选择旧版本驱动即可