My VPS(Bandwagon) include OpenVPN script, but only support Centos6.x that version not good for docker (my blog deploy by docker Blog顺利完成搬家之Bandwagonhost VPS), so need to do by other scripts. OpenWRT config OpenVPN client has some different, so summary the info to the article for review.
But due to GFW, OpenVPN couldn’t establish at last, reset happened between server and client, but the setup should workable.
Deploy OpenVPN at Server
Don’t know why couldn’t find OpenVPN pacakage by yum, even if have epel source
[root@frank ~]# rpm -qa |grep epel
epel-release-7-11.noarch
[root@frank ~]# yum install openvpn
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.usc.edu
* extras: repos.lax.quadranet.com
* updates: mirror.fileplanet.com
No package openvpn available.
Error: Nothing to do
Now Cisco had integrated BNG feature to XRv9000 platform in new version (from 631), that can let customer integrade the feature in their NFVI Infrastructure, that will flexible deploy the BNG in same Server Box. And the article will set up a simple vBNG environment that build by VIRL + XRv9000, and simple test IPoE/PPPoE. That environment will help you to easy TS vBNG PI issue, and packets paths.
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
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.
[root@bird-162 ~]# sed -i 's/lo:1/internet/g' route-internet
[root@bird-162 ~]# more route-internet
1.0.0.0/24 dev internet
1.0.4.0/22 dev internet
1.0.4.0/24 dev internet
1.0.5.0/24 dev internet
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
client:~ frank$ cd .ssh
client:.ssh frank$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/frank/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <<< 真实环境建议增加密码
Enter same passphrase again:
Your identification has been saved in /Users/frank/.ssh/id_rsa.
Your public key has been saved in /Users/frank/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:3zinN8lMY79WaSRDzbaBLQsT4KSlb9MDwrQfFc9FK+o frank@client
The key's randomart image is:
+---[RSA 3072]----+
| . +.+o *o |
| o B .oo+.*.|
| * + +++.o|
| + + .+.o |
| S= + + .|
| ..oo= o.|
| +Eo+.. |
| +* o |
| .. o.. |
+----[SHA256]-----+
client:.ssh frank$ ls -l
total 120
-rw-r--r-- 1 frank staff 751 May 11 2020 config
-rw------- 1 frank staff 2610 Feb 24 11:59 id_rsa <<< 私钥
-rw-r--r-- 1 frank staff 578 Feb 24 11:59 id_rsa.pub <<< 公钥
-rw------- 1 frank staff 23022 Feb 23 19:25 known_hosts
-rw-r--r--@ 1 frank staff 23377 Feb 22 21:00 known_hosts.old
拷贝的Server端
Frank@Yongs-MacBook-Pro ~ % ssh-copy-id -p 8080 -i ~/.ssh/id_rsa.pub [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/Frank/.ssh/id_rsa.pub"
The authenticity of host '[10.114.251.163]:8080 ([10.114.251.163]:8080)' can't be established.
ED25519 key fingerprint is SHA256:xxxxxxx
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh -p '8080' '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
[root@localhost ~]# more ~/.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias TG26='telnet 172.16.211.154 32897'alias PR11='telnet 172.16.211.154 32907'
alias PR12='telnet 172.16.211.154 32908'
# mv libpcap-1.10.4.tar.gz /usr/local/src/
# mv tcpdump-4.99.4.tar.gz /usr/local/src/
# cd /usr/local/src
# tar -xvf libpcap-1.10.4.tar.gz
# tar -xvf tcpdump-4.99.4.tar.gz
# cd libpcap-1.10.4
# ./configure
# make
# make install
# cd ../tcpdump-4.99.4
# ./configure
# make
# make install
# tcpdump --version
tcpdump version 4.99.4
libpcap version 1.10.4 (with TPACKET_V3)
root@f0-13:~# ftp
ftp> open x.x.x.x 11111
Connected to x.x.x.x.
220 frank-server FTP server ready.
Name (x.x.x.x:root): xxx
331 Password required for xxx.
Password:
230 User xxx logged in, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pas
Passive mode on.
% sudo more /etc/sudoers
......
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
xxx ALL = (ALL) ALL
[root@frank ~]# more /etc/cron.d/sysstat
# Run system activity accounting tool every 5 minutes
*/5 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A
查看SAR
只列几种常用的命令,具体可以通过-h查看更多option:
[root@frank ~]# sar -u #这里的信息是从二进制文件中读取的
Linux 4.10.4-1.el7.elrepo.x86_64 (frank) 08/09/2023 _x86_64_ (1 CPU)
01:57:57 AM LINUX RESTART
02:00:01 AM CPU %user %nice %system %iowait %steal %idle
02:10:01 AM all 1.34 0.00 0.50 0.25 0.00 97.91
Average: all 1.34 0.00 0.50 0.25 0.00 97.91
[root@frank ~]# sar -f /var/log/sa/sa09 #通过sar读取二进制文件
Linux 4.10.4-1.el7.elrepo.x86_64 (frank) 08/09/2023 _x86_64_ (1 CPU)
01:57:57 AM LINUX RESTART
02:00:01 AM CPU %user %nice %system %iowait %steal %idle
02:10:01 AM all 1.34 0.00 0.50 0.25 0.00 97.91
Average: all 1.34 0.00 0.50 0.25 0.00 97.91
root@sonic:/home/admin# ip link show Ethernet13
104: Ethernet13: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
link/ether 00:90:fb:7f:e1:2c brd ff:ff:ff:ff:ff:ff
Networkctl status xxx
此命令输出的信息会更详细
root@tme91:/home/tmelab# networkctl status ens3np0
● 4: ens3np0
Link File: /usr/lib/systemd/network/99-default.link
Network File: /run/systemd/network/10-netplan-ens3np0.network
Type: ether
State: routable (configured)
Path: pci-0000:27:00.0
Driver: mlx5_core
Vendor: Mellanox Technologies
Model: MT2910 Family [ConnectX-7]
HW Address: 58:a2:e1:xx:xx:xx
MTU: 4200 (min: 68, max: 9978)
Queue Length (Tx/Rx): 768/63
Auto negotiation: yes
Speed: 400Gbps
Duplex: full
Address: 192.168.100.1
fe80::5aa2:e1ff:fe06:3014
Activation Policy: up
Required For Online: yes
Connected To: sonic on port Ethernet27 (Ethernet27)
Sep 12 10:14:25 tme91 systemd-networkd[2372]: ens3np0: Lost carrier
Sep 12 10:14:39 tme91 systemd-networkd[2372]: ens3np0: Gained carrier
Ethtool
此命令很强大,之前一直用,为了方便,也列在这里方便后面review
root@tme91:/home/tmelab# ethtool ens3np0
Settings for ens3np0:
Supported ports: [ Backplane ]
Supported link modes: 1000baseT/Full
......
200000baseCR4/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Supported FEC modes: None BaseR RS
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: RS
Speed: 400000Mb/s
Duplex: Full
Port: Direct Attach Copper
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000004 (4)
link
Link detected: yes
root@tme91:/home/tmelab# mlxlink -d mlx5_0
Operational Info
----------------
State : Active
Physical state : ETH_AN_FSM_ENABLE
Speed : 400G
Width : 4x
FEC : Standard_RS-FEC - (544,514)
Loopback Mode : No Loopback
Auto Negotiation : ON
Supported Info
--------------
Enabled Link Speed (Ext.) : 0x00013ff2 (400G_4X,200G_2X,200G_4X,100G_1X,100G_2X,100G_4X,50G_1X,50G_2X,40G,25G,10G,1G)
Supported Cable Speed (Ext.) : 0x00013ffe (400G_4X,200G_2X,200G_4X,100G_1X,100G_2X,100G_4X,50G_1X,50G_2X,40G,25G,10G,5G,2.5G,1G)
Troubleshooting Info
--------------------
Status Opcode : 0
Group Opcode : N/A
Recommendation : No issue was observed
Tool Information
----------------
Firmware Version : 28.39.3560
amBER Version : 2.22
MFT Version : mft 4.26.1-6