The figure below calls out
- The netfilter hooks
- The order of table traversal
| # on a fresh Ubuntu 16.04 host | |
| sudo apt-get update | |
| # copy the packages from https://launchpad.net/debian/+source/openssh/1:7.4p1-10+deb9u3 | |
| wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1-10.dsc | |
| wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1.orig.tar.gz | |
| wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1-10.debian.tar.xz | |
| tar -zxvf openssh_7.4p1.orig.tar.gz |
| # on a fresh Ubuntu 16.04 host | |
| sudo apt-get update | |
| # copy Ubuntu source packages from http://archive.ubuntu.com/ubuntu/pool/main/o/openssh | |
| wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1-4.dsc | |
| wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1.orig.tar.gz | |
| wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1.orig.tar.gz.asc | |
| wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1-4.debian.tar.xz |
| # ------------------------------------------------ | |
| # Config files are located in /etc/wireguard/wg0 | |
| # ------------------------------------------------ | |
| # ---------- Server Config ---------- | |
| [Interface] | |
| Address = 10.10.0.1/24 # IPV4 CIDR | |
| Address = fd86:ea04:1111::1/64 # IPV6 CIDR | |
| PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started | |
| PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown |
| IFACE=wlp2s0 | |
| NS="ns1" | |
| VETH="veth1" | |
| VPEER="vpeer1" | |
| VETH_ADDR="10.200.1.1" | |
| VPEER_ADDR="10.200.1.2" | |
| ip li delete ${VETH} 2>/dev/null | |
| # Remove namespace if it exists. | |
| ip netns del $NS &>/dev/null |
| #!/usr/bin/env bash | |
| # set -x | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "You must be root to run this script" | |
| exit 1 | |
| fi | |
| # Returns all available interfaces, except "lo" and "veth*". |
| #!/usr/bin/env python3 | |
| import httpx | |
| import os | |
| import json | |
| BASE_YC_GPT_URL = "https://llm.api.cloud.yandex.net/foundationModels/v1/completion" | |
| calculator_tool = { |