用户名: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常用命令的更多相关文章

  1. Linux 常用命令(持续补充)

    常用命令: command &:将进程放在后台执行 ctrl + z:暂停当前进程 并放入后台 jobs:查看当前后台任务 bg( %id):将任务转为后台执行 fg( %id):将任务调回前 ...

  2. LVM基本介绍与常用命令

    一.LVM介绍LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制LVM - 优点:LVM通常用于装备大量磁盘的系统,但它同样适 ...

  3. Linux学习笔记(一):常用命令

    经过统计Linux中能够识别的命令超过3000种,当然常用的命令就远远没有这么多了,按照我的习惯,我把已经学过的Linux常用命令做了以下几个方面的分割: 1.文件处理命令 2.文件搜索命令 3.帮助 ...

  4. git常用命令(持续更新中)

    git常用命令(持续更新中) 本地仓库操作git int                                 初始化本地仓库git add .                       ...

  5. 【原】npm 常用命令详解

    今年上半年在学习gulp的使用,对npm的掌握是必不可少的,经常到npm官网查询文档让我感到不爽,还不如整理了一些常用的命令到自己博客上,于是根据自己的理解简单翻译过来,终于有点输出,想学习npm这块 ...

  6. npm常用命令

    npm常用命令 环境:win7 npm 是什么 NPM(node package manager),通常称为node包管理器.顾名思义,它的主要功能就是管理node包,包括:安装.卸载.更新.查看.搜 ...

  7. Git 常用命令

    一.初始環境配置 git config --global user.name "John Doe"git config --global user.email johndoe@ex ...

  8. linux iptables常用命令之配置生产环境iptables及优化

    在了解iptables的详细原理之前,我们先来看下如何使用iptables,以终为始,有可能会让你对iptables了解更深 所以接下来我们以配置一个生产环境下的iptables为例来讲讲它的常用命令 ...

  9. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

随机推荐

  1. 【PAT甲级】1108 Finding Average (20分)

    题意: 输入一个正整数N(<=100),接着输入一行N组字符串,表示一个数字,如果这个数字大于1000或者小于1000或者小数点后超过两位或者压根不是数字均为非法,计算合法数字的平均数. tri ...

  2. ALSA driver--HW Buffer

    当app在调用snd_pcm_writei时,alsa core将app传来的数据搬到HW buffer(即DMA buffer)中,alsa driver从HW buffer中读取数据传输到硬件播放 ...

  3. 【网搜】禁止 number 输入非数字(Android仍有问题)

    目的:使用 number 表单,让其只可输入数字. 问题:ios 可正常限制,Android 仍可输入  [ e | . |  - |  + ]   这4个字符.猜测这4个字符在数值中为科学记数.小数 ...

  4. Flask 学习之flask入门

    一.Flask的简单介绍 Flask是一个基于Python开发并且依赖jinja2模板和Werkzeug WSGI服务的一个微型框架,对于Werkzeug本质是Socket服务端,其用于接收http请 ...

  5. Mac电脑怎么远程桌面连接

    https://jingyan.baidu.com/article/e75aca85039448142fdac651.html https://blog.csdn.net/youshaoduo/art ...

  6. 关于XMlHttpRequest对象

    //创建XMLHttpRequest对象的三种方法 1 var xhr = createXMLHttpRequest(); function createXMLHttpRequest(){ try{ ...

  7. hackinglab 种族歧视

    首先打开题目 发现是禁止访问的然后打开后台 发现后台也没有什么有用的信息所以用bp抓包 然后修改一下国家语言

  8. gRPC Learning Notes

    简介 更多内容参考:https://www.grpc.io/docs/guides/ gRPC 是一个高性能.开源和通用的 RPC 框架,面向移动和 HTTP/2 设计.目前提供 C.Java 和 G ...

  9. 全排列dfs

    #include <iostream> #include <vector> using namespace std; vector<int> ans; const ...

  10. 基于SILVACO ATLAS的a-IGZO薄膜晶体管二维器件仿真(05)

    关于特性曲线的输出调整: 初代版本 material material=igzo eg300=3.5 nc300=8.5e21 nv300=8.5e21 taun0=1e-9 taup0=1e-9 a ...