Skip to content

Instantly share code, notes, and snippets.

View lero's full-sized avatar

Guilherme M. Schroeder lero

View GitHub Profile
#!/usr/bin/env python
from scapy.all import *
conf.checkIPaddr=False
# configuration
localiface = 'eno1'
requestMAC = 'ac:16:2d:ab:14:98'
myhostname = '\0'
[root@styx ~]# ip link add link enp4s0 name enp4s0.100 type vlan id 100
[root@styx ~]# nft add table nat
[root@styx ~]# nft add chain nat prerouting { type nat hook prerouting priority 0 \; }
[root@styx ~]# nft add chain nat postrouting { type nat hook postrouting priority 0 \; }
[root@styx ~]# nft add rule nat postrouting ip saddr 192.168.1.0/24 oif enp4s0.100 masquerade
[root@styx ~]# nft list table nat
table ip nat {
chain prerouting {
type nat hook prerouting priority 0;
}