Skip to content

Instantly share code, notes, and snippets.

View amkgi's full-sized avatar

Alexey Kashavkin amkgi

View GitHub Profile
@max-i-mil
max-i-mil / linux-vms-on-apple-m1-with-networking.md
Last active March 15, 2025 03:15
Short summary to run Linux VMs on an Apple M1 host using QEMU, libvirt and HVF with a working network setup

Linux Virtual Machines with Private Network on an Apple M1 Device

Background

The aim was to be able to:

  1. Run multiple Linux VMs on an Apple M1/ARM device
  2. Use Apple's HVF for native performance speeds
  3. Configure VMs to allow network access to each other
  4. Configure VMs to allow access to the internet
  5. Not rely on custom modifications of software
@refraction-ray
refraction-ray / ipoption.py
Last active January 30, 2025 13:25
extension functions on IPOption settings in scapy
from scapy.all import sr1, IP, IPOption,ICMP
import ipaddress as ipa
def record_route(hop=1):
if hop >= 10:
raise Exception('exceed the max length of ip header')
length = chr(hop*4+3)
option_head = b'\x07'+length.encode()+b'\x04'
route_data = "".join(['\x00']*4*hop)
option = option_head+('%s'%route_data).encode()