1.基于网络设备的负载均衡
2.基于操作系统的负载均衡
####Cisio的以太网通道
把3-4根线连在一起,把单车道变成4车道 1根线为100M 3根就变成300M,通道技术
forward-zone: | |
name: "apple.com" | |
forward-addr: 223.5.5.5 | |
forward-zone: | |
name: "itunes.com" | |
forward-addr: 223.5.5.5 | |
forward-zone: | |
name: "akadns.net" | |
forward-addr: 223.5.5.5 | |
forward-zone: |
#!/usr/bin/perl | |
# | |
# Purpose: Dump mac address to port mappings from a switch | |
# | |
# Usage: ./dump_mac_table.pl <switch ip/hostname> [community] | |
# | |
# Requires: | |
# - CPAN SNMP::Info module (hint: cpan SNMP::Info) | |
# - Cisco SNMP MIBs | |
# ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
#!/bin/bash | |
if [ "$4" == "" ]; then | |
echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>" | |
echo "creates an ipsec tunnel between two machines" | |
exit 1 | |
fi | |
SRC="$1"; shift | |
DST="$1"; shift |
1:设置
sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sysctl -p
2:安装
https://www.wireguard.com/install/
Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
Important: your node location may vary. Use which node
to find it, or use it directly in the command:
##ss-redir 的 iptables 配置(透明代理)
透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则
创建 /etc/ss-redir.json 本地监听 7777
运行ss-redir -v -c /etc/ss-redir.json
iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
由于路由管控系统的建立,实时动态黑洞路由已成为最有效的封锁手段,TCP连接重置和DNS污染成为次要手段,利用漏洞的穿墙方法已不再具有普遍意义。对此应对方法是多样化协议的VPN来抵抗识别。这里介绍一种太简单、有时很朴素的“穷人VPN”。
朴素VPN只需要一次内核配置(Linux内核),即可永久稳定运行,不需要任何用户态守护进程。所有流量转换和加密全部由内核完成,原生性能,开销几乎没有。静态配置,避免动态握手和参数协商产生指纹特征导致被识别。并且支持NAT,移动的内网用户可以使用此方法。支持广泛,基于L2TPv3标准,Linux内核3.2+都有支持,其他操作系统原则上也能支持。但有两个局限:需要root权限;一个隧道只支持一个用户。
朴素VPN利用UDP封装的静态L2TP隧道实现VPN,内核XFRM实现静态IPsec。实际上IP-in-IP隧道即可实现VPN,但是这种协议无法穿越NAT,因此必须利用UDP封装。内核3.18将支持Foo-over-UDP,在UDP里面直接封装IP,与静态的L2TP-over-UDP很类似。