mosers
/
eaas-vde-proxy
Archiviert
1
0
Fork 0
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

1.5 KiB

eaas-vde-proxy

Overview

overview

Pseudocode

class vde_proxy:    
    def handle_frame(frame):
        try:
            frame.mac = self.new_mac        
        except NameError:
            self.new_mac = random_mac()
            self.new_ip = do_dhcp(new_mac)
        finally:
            frame.mac = self.new_mac
        frame.packet = handle_packet(frame.packet)
            
    def handle_packet(packet):
        protocols = {
            "ip" : handle_ip,
            "arp": handle_arp,
        }
        return protocols[packet.protocol](packet)
            
    def handle_ip(packet):
        # Todo: Check DHCP lease and get new one if necessary
        packet.ip = self.new_ip
        if is_dhcp(packet):
            packet = handle_dhcp(packet)
        return packet
        
    def handle_arp(packet):
        pass
    
    def handle_dhcp(packet):
        pass
    
    def do_dhcp(mac):
        # Do DHCP
        return ip

Problematic protocols

Important:

  • DHCP
  • ARP

Nice to have:

  • NetBEUI / NetBIOS

Keep in mind:

  • IPv6 (NDP, Interface Identifier, ...)
  • IPSec
  • 802.1X

Library support

Go:

Rust: