上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 69 下一页

2024年3月25日

iperf3测试网卡tcp带宽

摘要: iperf3 # 安装iperf3 apt install -y iperf3 # 服务端 iperf3 -s -p 5001 # 客户端 iperf3 -c 192.168.0.112 -p 5001 说明最大带宽是4.25Gb/s。 阅读全文

posted @ 2024-03-25 09:02 王景迁 阅读(161) 评论(0) 推荐(0)

2024年3月22日

go 操作ip

摘要: 获取网卡IPv4地址 package main import ( "fmt" "net" ) func main() { ifname := "ens33" netIf, err := net.InterfaceByName(ifname) if err != nil { fmt.Printf("g 阅读全文

posted @ 2024-03-22 08:57 王景迁 阅读(38) 评论(0) 推荐(0)

2024年3月13日

制作Ubuntu qcow2镜像

摘要: 下载云主机镜像 https://cloud-images.ubuntu.com/releases/ wget https://cloud-images.ubuntu.com/releases/23.10/release-20240307/ubuntu-23.10-server-cloudimg-am 阅读全文

posted @ 2024-03-13 09:11 王景迁 阅读(647) 评论(0) 推荐(0)

client-go使用技巧

摘要: Pod使用spec.serviceAccountName对应的token import "k8s.io/client-go/rest" cfg, err := rest.InClusterConfig() if err != nil { klog.Fatalf("Error building kub 阅读全文

posted @ 2024-03-13 08:51 王景迁 阅读(69) 评论(0) 推荐(0)

2024年3月10日

busybox容器配置北京时间

摘要: docker pull busybox:1.32 docker run --rm -v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime -itd busybox:1.32 sh k8s挂载 volumeMounts: - name: timezone 阅读全文

posted @ 2024-03-10 21:37 王景迁 阅读(38) 评论(0) 推荐(0)

Python scapy模拟dhcp客户端

摘要: 安装scapy apt install -y python3-scapy 1. 发送dhcp discover广播报文2. sniff抓包,收到dhcp offer广播报文(可能来自多个dhcp服务端)3. 向1个dhcp服务端发送dhcp request广播报文4. sniff抓包,收到dhcp 阅读全文

posted @ 2024-03-10 17:14 王景迁 阅读(862) 评论(0) 推荐(0)

2024年3月8日

DHCP协议

摘要: DHCP动态主机配置协议,客户端根据mac从服务端获取ip等信息并到期前续约。 协议字段 图中单位是字节。 字段op 值 含义 1 客户端发送Discover广播请求,包括自身mac。 2 服务端回复Offer广播响应。 3 客户端发送Request广播,告知选择的服务端,希望获得分配的IP。 IP 阅读全文

posted @ 2024-03-08 08:55 王景迁 阅读(40) 评论(0) 推荐(0)

2024年2月26日

go 同一个https端口实现多种认证方式

摘要: 参考kube-apiserver,访问https端口时,-k允许跳过默认的证书认证,从而实现多种认证方式。 package main import ( "crypto/tls" "fmt" "net/http" klog "k8s.io/klog/v2" ) func healthCheck(w h 阅读全文

posted @ 2024-02-26 09:08 王景迁 阅读(63) 评论(0) 推荐(0)

2024年2月21日

分析kube-apiserver单次创建namespace耗时

摘要: 日志输出 # 业务日志 I0220 22:12:39.149364 40965 multi_config_multi_clientset.go:63] begin to wait cache sync I0220 22:12:39.250461 40965 multi_config_multi_cl 阅读全文

posted @ 2024-02-21 23:37 王景迁 阅读(55) 评论(0) 推荐(0)

2024年2月20日

eBPF demo

摘要: ubuntu server 23.10 eBPF介绍 eBPF(Extended Berkeley Packet Filter,扩展的伯克利数据包过滤器)前身是BPF(Berkeley Packet Filter,伯克利数据包过滤器)。BPF合入linux kernel,在tcpdump中应用。eB 阅读全文

posted @ 2024-02-20 08:48 王景迁 阅读(175) 评论(0) 推荐(0)

上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 69 下一页

导航