PacketGen-Go is a powerful command-line Ethernet packet generator written in Go. It supports custom packet crafting, multiple protocols, various traffic patterns, and real-time monitoring of network traffic generation.
-
Packet Crafting
- Custom MAC addresses
- Configurable EtherType
- Variable payload sizes
- VLAN tagging support
-
Protocol Support
- IPv4
- IPv6
- ARP
- TCP
- UDP
- VLAN
- Custom protocols via EtherType
-
Traffic Generation
- Adjustable packet rates
- Configurable packet counts
- Continuous mode
- Multiple traffic patterns (sequential, random, burst)
-
Interface Management
- List available network interfaces
- Interface selection
- Interface details (MAC, IP addresses)
-
Real-time Monitoring
- Packets sent counter
- Current transmission rate
- Bandwidth utilization
- Error tracking
Before installing PacketGen-Go, ensure you have the following prerequisites:
- Go 1.16 or higher
- libpcap development headers
For Ubuntu/Debian:
sudo apt-get install libpcap-dev
For RedHat/Fedora/CentOS:
sudo dnf install libpcap-devel
For macOS:
brew install libpcap
- Clone the repository:
git clone https://github.com/Ali-Farhadnia/PacketGen-Go.git
cd PacketGen-Go
- Install dependencies:
go get github.com/google/gopacket
- Build the project:
go build
sudo ./PacketGen-Go --list
sudo ./PacketGen-Go -i eth0 -src-mac 00:11:22:33:44:55 -dst-mac 66:77:88:99:AA:BB -rate 1000 -count 10000
-i : Network interface name (required)
-list : List available network interfaces
-src-mac : Source MAC address
-dst-mac : Destination MAC address
-ether-type : EtherType value (default: IPv4)
-payload-size: Payload size in bytes (default: 46)
-protocol : Protocol (ipv4, ipv6, arp, tcp, udp)
-rate : Packets per second (default: 1000)
-count : Number of packets to send (0 for continuous)
-vlan : VLAN ID (-1 to disable)
-mode : Traffic mode (sequential, random, burst)
Generate VLAN tagged traffic:
sudo ./PacketGen-Go -i eth0 -src-mac 00:11:22:33:44:55 -dst-mac 66:77:88:99:AA:BB -vlan 100
Generate random traffic:
sudo ./PacketGen-Go -i eth0 -src-mac 00:11:22:33:44:55 -dst-mac 66:77:88:99:AA:BB -mode random
Continuous traffic generation:
sudo ./PacketGen-Go -i eth0 -src-mac 00:11:22:33:44:55 -dst-mac 66:77:88:99:AA:BB -count 0
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- gopacket library for packet manipulation
- libpcap for packet capture and transmission
Please note that this tool can generate significant network traffic. Use responsibly and only on networks you own or have permission to test. Misuse of this tool could violate laws or network policies.