This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from scapy.all import * | |
conf.checkIPaddr=False | |
# configuration | |
localiface = 'eno1' | |
requestMAC = 'ac:16:2d:ab:14:98' | |
myhostname = '\0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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; | |
} |