VYOS 开源路由简易编译教程/镜像构建

这是一篇简短的文章,展示了如何构建自己的 VyOS LTS iso 映像。已经在 Debian Buster(Debian 10)通过测试!~

安装 Docker

$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
$ sudo apt-get update
$ sudo apt-get install -y docker-ce

$ sudo usermod -aG docker <Your username>

注:国内网络环境可参考 https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/

阅读全文»

VYOS 安装与基础命令

安装

vyos@vyos:~$ install image
Welcome to the VyOS install program.  This script
will walk you through the process of installing the
VyOS image to a local hard drive.
Would you like to continue? (Yes/No) [Yes]: Yes
Probing drives: OK
Looking for pre-existing RAID groups...none found.
The VyOS image will require a minimum 2000MB root.
Would you like me to try to partition a drive automatically
or would you rather partition it manually with parted?  If
you have already setup your partitions, you may skip this step
 
Partition (Auto/Parted/Skip) [Auto]:
 
I found the following drives on your system:
 sda    4294MB
 
Install the image on? [sda]:
 
This will destroy all data on /dev/sda.
Continue? (Yes/No) [No]: Yes
 
How big of a root partition should I create? (2000MB - 4294MB) [4294]MB:
 
Creating filesystem on /dev/sda1: OK
Done!
Mounting /dev/sda1...
What would you like to name this image? [1.2.0-rolling+201809210337]:
OK.  This image will be named: 1.2.0-rolling+201809210337
Copying squashfs image...
Copying kernel and initrd images...
Done!
I found the following configuration files:
    /opt/vyatta/etc/config.boot.default
Which one should I copy to sda? [/opt/vyatta/etc/config.boot.default]:
 
Copying /opt/vyatta/etc/config.boot.default to sda.
Enter password for administrator account
Enter password for user 'vyos':
Retype password for user 'vyos':
I need to install the GRUB boot loader.
I found the following drives on your system:
 sda    4294MB
 
Which drive should GRUB modify the boot partition on? [sda]:
 
Setting up grub: OK
Done!



vyos@vyos:~$ reboot
Proceed with reboot? (Yes/No) [No] Yes

阅读全文»

IPv4 / IPv6 双栈网络优先使用 IPv4 协议栈 Windows / Linux 设置方法

最近这几年国内网络基本都普及了 IPv4 / IPv6 双栈网络,可是在使用过程中,却经常发现 IPv6 的路由比较差,无论是响应速度还是质量都堪忧,就目前阶段而言国内 IPv6 的 Peer 还不能和 IPv4 相比。

根据 RFC3484 规定在双栈网络的情况下,默认都是优先使用 v6 协议,如果无法连接或超时则会回落 v4 这个时间大概是 300ms 左右。不过在实际使用过程中发现,使用 v6 访问时异常缓慢,原因如文章开头所述。例如在更新 Linux 软件包时如果使用优先的 v6 协议栈,那你就慢慢等吧。

阅读全文»

开放 API 接口安全设计思路

开放API接口安全校验的背景:

在未进行安全处理的开放 API 接口存在诸多的风险问题,如以下三种常见场景:

1、场景一
A 公司开发的开放 API 未对接口进行安全控制,有黑客通过爬虫程序调用开放 API 查询客户信息的接口,由于没有安全验证,A 公司的客户数据通过客户信息查询 API 流出,竞争公司拥有了这批客户数据,对 A 公司造成损失。

2、场景二
A 公司开发的开放 API 未对接口进行防篡改控制,有客户购买价值 1 万元的产品,现有黑客通过技术手段,对客户提交的表单进行篡改,将 1 万元的价格改成 100 元,对公司造成了经济损失。

3、场景三
A 公司开发的开放 API 未进行接口安全控制,有黑客截取了客户的用户名,密码信息。黑客用客户的用户名,密码登录,查阅客户的相关隐私信息,盗刷了客户的信用卡,给客户造成了损失。

这三种常见未进行开放 API 接口校验的场景对公司以及客户造成损失的都是不可修补的,也反映了普遍开放式 API 接口存在的安全问题。那么,在编写开放 API 接口时如何保障数据传输安全性?




阅读全文»