Archive

标签为 ‘Linux’的文章

Compile SRv6 uSID and VPP on ubuntu 20.04

PS: Compile Server base on “focal-server-cloudimg-amd64.vmdk”, 20200706 update.

General Config on ubuntu

Config port by new “ip” cmd

root@server-test:/opt# ip addr add 10.75.37.59/24 dev ens4
# config addr for one port 
root@server-test:/opt# ip addr del 172.16.1.163/24 dev ens3
# delet addr for one port
root@server-test:/opt# ip addr
# equal with ifconfig
root@server-test:/opt# ip link set ens4 up
# up one port 
root@server-test:/opt# ip -s link ls ens4
# cool cmd, check RX/TX packets, errors, dropped, overrun, mcast
root@server-test:/opt# ip route add default via 10.75.37.1 
# config default route
root@server-test:/opt# ip route
# check v4 route table
root@server-test:/opt# ip -6 route
# check v6 route table

完整阅读

0

Cisco 网络自动化展示

PS:视频在油管上,需要搭梯子……

Summary intros session, and there are two separate demo sessions to deep dive, as follow:

完整阅读

0

CISCO WAE: wae-db dead but pid file exists

Introduction

If you found similar alarms, you can follow the guide and try to workaround the issue.

Problem

My customer found WAE REST API not workable, after checked, found wae-db have issue and report alarm, as follow.
And try to restart the WAE service and reload VM, not any useful.

[root@wae-auto wae-db]# service --status-all | grep wae
JAVA_EXECUTABLE or HSQLDB_JAR_PATH in '/etc/sysconfig/hsqldb' is set to a non-file.
wae-appenginecore is running OK, with PID=18606
wae-core is running OK, with PID=18163
wae-db dead but pid file exists  <<<<<<
wae-designapiserver is running OK, with PID=18847
wae-messaging is running OK, with PID=17874
wae-ni is running OK, with PID=17525
wae-osc is running OK, with PID=18369
wae-svcs-dashui is running OK, with PID=16652
wae-svcs-db is running OK, with PID=16277
wae-svcs-localrepo is not running
wae-svcs-log is running OK, with PID=16497
wae-svcs-logagent is running OK, with PID=16570
wae-svcs-metricsbkr is running OK, with PID=16716
wae-svcs-metricsd is running OK, with PID=16806
wae-svcs-mon is running OK, with PID=16138
wae-svcs-ui is running OK, with PID=16917
wae-system-server is running OK, with PID=16186
wae-web-server is running OK, with PID=17761

完整阅读

0

INSTALL CISCO WAE 6.4.5

Introduction

After installed Centos 6.7 for CISCO WAE, I found python version is 2.6 that is much older, and I need ansible1.9, but Centos default upgrade to ansible2.2… in order to easy management ansible1.9 that is python package, I plan to install PIP. From official website, suggest not use 2.6 under pip, so I need to upgrade python to 2.7 too.

But I found WAE use 2.6 after I succeed upgrade python to 2.7…Summarized the totally steps that will help me review in future.

Upgrade Python

After checked from follow link, python 2.7.9 integrate pip, so install this version 🙂
https://pip.pypa.io/en/latest/installing/

1. Install some package that require by python

python have multi dependencie

[root@wae ~]# yum install gcc
[root@wae ~]# yum install openssl-devel

2. Install python 2.7.9

[root@wae ~]# wget http://python.org/ftp/python/2.7.9/Python-2.7.9.tgz
[root@wae ~]# mv Python-2.7.9.tgz /opt/
[root@wae ~]# cd /opt/
[root@wae opt]# tar -xvf Python-2.7.9.tgz 
[root@wae opt]# cd Python-2.7.9
[root@wae Python-2.7.9]# ./configure --prefix=/usr/local/python2.7
[root@wae Python-2.7.9]# make
[root@wae Python-2.7.9]# make install

完整阅读

0

linux/Unix tips

Grep, awk and xargs

ps -ef | grep frank | grep soft_router | awk ‘{print $2}’ | xargs kill
grep: 过滤
awk:文本分析工具
xargs: 跟其他命令配合如使用,扩展名了

tar and zip

tar -cvf test-tar.tar nvgen_traces     >>> create test folder to zip file
tar -xvf test-tar.tar     >>> extract tar file
zip -r 661-yang.zip yang
unzip 661-yang.zip

Find command

$find ~ -name “*.txt” -print
查找目录:find /(查找范围) -name ‘查找关键字’ -type d
http://blog.csdn.net/windone0109/article/details/2817792
http://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/f/find.html
http://blog.csdn.net/ldl22847/article/details/7611119

GREP常用Option:

-c:只输出匹配行的计数。
-i:不区分大 小写(只适用于单字符)。
-h:查询多文件时不显示文件名。
-l:查询多文件时只输出包含匹配字符的文件名。
-n:显示匹配行及 行号。
-s:不显示不存在或无匹配文本的错误信息。
-v:显示不包含匹配文本的所有行。
#more size.txt | grep -inv ‘test’ #查找不包含“test”的匹配项的行
#more size.txt | grep -inv ‘test’ >>xxx #过滤后的信息重定向到一个文件中,xxx是你的文件名
#grep -E ’10G|VID’ file #查找包含10G或包含VID的行,-E是扩展模式,同等于egrep

pattern正则表达式主要参数:

\: 忽略正则表达式中特殊字符的原有含义。
^:匹配正则表达式的开始行。
$: 匹配正则表达式的结束行。
\<:从匹配正则表达式的行开始。
\>:到匹配正则表达式的行结束。
[ ]:单个字符,如[A]即A符合要求 。
[ – ]:范围,如[A-Z],即A、B、C一直到Z都符合要求 。
. :所有的单个字符。
* :有字符,长度可以为0。

文本输出太多,可以用下面命令,然后左划线过滤:

在命令后面加 | more. 可以每屏按键后翻。想退出按 q
命令后面加| less ,可以前后翻。想退出按 q

加路由并查看路由表:

$sudo route add -net 10.10.10.0/24 192.168.255.131
Password:
add net 10.10.10.0: gateway 192.168.255.131
$ netstat -r
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            hsrp-10-140-0-0.ci UGSc           31        0     en0
10.10.10/24        192.168.255.131    UGSc            0        0  vmnet8

$ netstat -in
Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll
lo0   16384 <link#1>                         64058     0    64058     0     0

关闭防火墙

[root@frank ~]# systemctl stop firewalld.service 
[root@frank ~]# systemctl disable firewalld.service 
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. 
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

2020-07-07 更新:关闭ubuntu 防火墙

最近拿ubuntu做测试,发现ipv6流量被防火墙block了。。。花了很长时间才找到原因,由于是测试的是SRv6,所以怀疑内核不稳定,同事还尝试升级了内核。。。

按理说ubuntu默认应该是关闭防火墙的。。。用下面命令关闭ubuntu的防火墙:

[root@frank ~]# ufw disable
[root@frank ~]# ufw status

临时开启httpserver,remote直接wget即可

[root@frank opt]# python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...

安装并打开流量监控

2020-02-Update1

[root@nso ~]# yum -y install iftop

[root@nso ~]# iftop
interface: ens192
IP address is: 10.75.37.87
MAC address is: 00:50:56:80:32:2c
              12.5Kb         25.0Kb         37.5Kb         50.0Kb   62.5Kb
+-------------+--------------+--------------+--------------+--------------
nso                     => xxx                    3.47Kb  3.19Kb  3.19Kb
                        <=                          416b    624b    624b 
nso                     => yyy                        0b    566b    566b 
                        <=                            0b   1.66Kb  1.66Kb
nso                     => gateway                  672b    504b    504b
                        <=                          672b    504b    504b



















--------------------------------------------------------------------------
TX:             cum:   2.12KB   peak:   4.rates:   4.12Kb  4.23Kb  4.23Kb
RX:                    1.38KB           4.47Kb     1.06Kb  2.77Kb  2.77Kb
[root@nso ~]#          3.50KB           8.80Kb     5.19Kb  7.00Kb  7.00Kb

安装并使用NSF的cache

2020-02-Update2

针对服务器用NSF搭建的环境,跨广域网挂载非常慢,而且每次都经理很通过的下载,如何解决类似问题?我们可以开启cache,这样第二次打开后就不会有问题了,下面是安装和配置:

[root@nso ~]# yum install -y cachefilesd
[root@nso ~]# cat /etc/cachefilesd.conf

安装后我们要找到NSF的挂载点,然后在NSF中设置cache,可以通过安装lsof这个工具来找到挂载点

 [root@nso ~]# sudo yum install lsof

安装后打开lsof并触发一个automount的挂载点,我们可以找到相应的挂载服务器,找到后去automount文件给相应的服务器加上cache标识,如下:

fcs是cache的标识,默认没有,就是要对这个挂载点开启cache;frank-server就是 NSF server的hostname;/abc/xyz就是从lsof中查到的挂载点的真正位置信息;xxx就是/auto目录下自动挂载的目录名称:

[root@nso ~]# more /etc/auto.indirect |grep /abc/xyz
xxx -rw,hard,intr,quota,fsc frank-server:/abc/xyz

0
blonde teen swallows load.xxx videos