用户名: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. 题解【POJ1651】Multiplication Puzzle

    Description The multiplication puzzle is played with a row of cards, each containing a single positi ...

  2. Xcode 内存泄露检查出现:nil returned from a method that is expected to return a non-null value iOS 解决方案。

    在 使用 Xcode 检查内存泄露时(cmd+shift+B)运行,出现了一个警告:nil returned from a method that is expected to return a no ...

  3. Java Web实现使用浏览器从服务器下载文件(后台)

    Java Web实现 使用浏览器从服务器下载文件. 下面实现两种情况的下载,需求如下: 需求(一):1.用户在页面填写表单. 2.填写完成后,选择下载,将表单内容发往后台. 3.后台根据内容生产一个文 ...

  4. js-秒数转为XX时XX分XX秒(用于计算剩余时间或倒计时)

    export default { data() { return { hours: null, minute: null, second: null } }, methods: { // 秒数 转为 ...

  5. STM32F103之USART学习记录

    1.USART的主要特性 1)名称:串行异步通信接口 2)全双工.异步通信 3)发送和接收速率最高可达4.5MBits/s 4)可编程数据长度8或9bits 5)可配置的停止位:支持1或2位停止位 6 ...

  6. bugku 过狗一句话

    题目描述: 题目描述:                                上面的php进行格式化之后: <?php     $poc="a#s#s#e#r#t"; ...

  7. 【代码学习】PYTHON 线程

    一.使用threading模块多线程执行 可以明显看出使用了多线程并发的操作,花费时间要短很多 创建好的线程,需要调用start()方法来启动 #coding=utf-8 import threadi ...

  8. EntityFramework中使用sql语句

    https://blog.csdn.net/yangyangafan/article/details/77602133 EntityFramework操作数据库谜一般的方便还不用写数据库,但前提是很简 ...

  9. 【Android】数据存储和访问

    一.SharedPreferences 2.SQLite

  10. nginx-cache

    test.conf proxy_cache_path cache levels=1:2 keys_zone=my_cache:10m; server { listen 80; server_name ...