Skip to content

Instantly share code, notes, and snippets.

View kona3266's full-sized avatar

Dean kona3266

  • CN
View GitHub Profile
#!/bin/bash
brctl addbr br0
ip netns add t1
ip netns add t2
ip netns add t3
ip link add t1 type veth peer name t11
ip link add t2 type veth peer name t22
ip link add t3 type veth peer name t33
@kona3266
kona3266 / tc_mirred.sh
Last active January 21, 2025 01:25
tc action mirred
#!/bin/bash
ip netns add t1
ip netns add t2
ip link add t1 type veth peer name t11
ip link add t2 type veth peer name t22
ip link set t11 netns t1
ip link set t22 netns t2
#!/usr/bin/env python3
import paramiko
import asyncio
import time
import asyncssh
import sys
pubkey_str = ''
with open("/root/.ssh/id_rsa.pub") as f:
@kona3266
kona3266 / tc.sh
Last active December 29, 2024 05:10
tc-bash
#!/bin/bash
#set -x
function usage()
{
echo "Usage:"
echo " tc.sh -d <dev> -b <bandwidth> -m <mode> --src <src_ip>"
echo " <dev> is the device which tc be attached to"
echo " <bandwidth> unit is Mb"
echo " <mode> 0 contains class while 1 does not, default 0"
echo " <src_ip> match source ip default empty"