8000 GitHub - gkhays/ipv6-tools: Some basic tools to experiment with and test IPv6
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gkhays/ipv6-tools

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

IPv6 Tools

Java Python Docker License

A collection of tools for testing and experimenting with IPv6 connectivity. This project provides a simple client-server implementation to verify IPv6 communication.

🌟 Features

  • IPv6 server implementation
  • IPv6 client implementation
  • Real-time message exchange
  • Timestamp-based logging
  • Configurable port and IPv6 address
  • Support for both local and remote IPv6 connections
  • Automatic listing of available IPv6 addresses on the host
  • Multi-client support (up to 10 simultaneous connections)

πŸ“‹ Prerequisites

  • Java 23 or higher
  • Python 3.13 or higher
  • Docker 27.5 or higher
  • IPv6-enabled network environment
  • Basic understanding of IPv6 addressing

πŸš€ Installation

  1. Clone the repository:
git clone https://github.com/yourusername/ipv6-tools.git
cd ipv6-tools

🐳 Docker

  1. Build the container images.
./build.sh

πŸ’» Usage

Container Versions

The IPv6 tester utilities may be run in either server or client mode.

Running as Server

docker run --rm -it ipv6tester-java

Running as Client

docker run --rm -it ipv6tester-java IPv6Tester.java client

The pattern is similar for the Python utility. Invoke the Python container (ipv6tester-python) and substitute ipv6_tester.py for IPv6Tester.java. Additional address and port parameters apply as below.

Java Version

The IPv6Tester class can be run in either server or client mode. Here are the basic usage patterns:

Running as Server

java java/src/IPv6Tester.java server [ipv6_address] [port]

Running as Client

java java/src/IPv6Tester.java client [ipv6_address] [port]

Viewing Available IPv6 Addresses

To see all available IPv6 addresses on your system, simply run the tool without any arguments:

java java/src/IPv6Tester.java

Python Version

The Python version provides the same functionality using async/await patterns. Here are the usage patterns:

Running as Server

python python/src/ipv6_tester.py server [ipv6_address] [port]

Running as Client

python python/src/ipv6_tester.py client [ipv6_address] [port]

Viewing Available IPv6 Addresses

To see all available IPv6 addresses on your system, simply run the tool without any arguments:

python python/src/ipv6_tester.py

πŸ“ Examples

Java Examples

  1. View available IPv6 addresses and usage help:
java java/src/IPv6Tester.java
  1. Start a server on the default IPv6 address (::1) and port (8080):
java java/src/IPv6Tester.java server
  1. Start a server on a specific IPv6 address and port:
java java/src/IPv6Tester.java server 2001:db8:1234:5678::1 8888
  1. Connect a client to the server:
java java/src/IPv6Tester.java client 2001:db8:1234:5678::1 8888

Python Examples

  1. View available IPv6 addresses and usage help:
python python/src/ipv6_tester.py
  1. Start a server on the default IPv6 address (::1) and port (8080):
python python/src/ipv6_tester.py server
  1. Start a server on a specific IPv6 address and port:
python python/src/ipv6_tester.py server 2001:db8:1234:5678::1 8888
  1. Connect a client to the server:
python python/src/ipv6_tester.py client 2001:db8:1234:5678::1 8888

πŸ” How it Works

  • The server listens for incoming IPv6 connections on the specified address and port
  • The client connects to the server and sends messages
  • The server responds with timestamps and acknowledgment messages
  • Both sides log all communication for debugging purposes
  • The server can handle up to 10 simultaneous client connections
  • When no arguments are provided, the tool displays available IPv6 addresses on the system

πŸ“Š Output Examples

Server Mode Output

When running in server mode, you'll see output like this:

IPv6 Server started on [2001:db8:1234:5678::1]:8080
Maximum number of simultaneous clients: 10
Client connected from: [2001:db8:1234:5678::2]
Received from client [2001:db8:1234:5678::2]: Hello from IPv6 client at 2024-03-21 14:30:45

The server will:

  1. Display the IPv6 address and port it's listening on
  2. Show the maximum number of simultaneous clients allowed
  3. Show when a client connects, including the client's IPv6 address
  4. Log each message received from the client
  5. Send back acknowledgment messages with timestamps

Client Mode Output

When running in client mode, you'll see output like this:

Connected to server at [2001:db8:1234:5678::1]:8080
Sent to server: Hello from IPv6 client at 2024-03-21 14:30:45
Server response: Server received your message at 2024-03-21 14:30:45 at address 2001:db8:1234:5678::1

The client will:

  1. Confirm successful connection to the server
  2. Show each message sent to the server
  3. Display the server's response with timestamps
  4. Continue this pattern for 20 iterations with 1-second delays between messages

Available IPv6 Addresses Output

When running without arguments, you'll see output like this:

Usage: python ipv6_tester.py <server|client> [ipv6_address] [port]
  server|client    - Required. Run as server or client
  ipv6_address     - Optional. IPv6 address (default: ::1)
  port             - Optional. Port number (default: 8080)

Available IPv6 addresses on this host:
  eth0: 2001:db8:1234:5678::1
  wlan0: 2001:db8:abcd:efgh::1
  lo: ::1

Python IPv6 related properties:
  socket.AF_INET6: 10
  socket.has_ipv6: True
  IPV6_V6ONLY environment variable: not set

System IPv6 configuration:
  System IPv6 enabled: true
  (On macOS, shows: System IPv6 forwarding: net.inet6.ip6.forwarding: 1)

Examples:
  python ipv6_tester.py server
  python ipv6_tester.py server 2001:db8:1234:5678::1
  python ipv6_tester.py client 2001:db8:1234:5678::1 8888

The output includes:

  1. Available IPv6 addresses on the system
  2. Python's IPv6 capabilities and configuration
  3. System-level IPv6 status
  4. Usage examples and command-line options

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Inspired by the need for simple IPv6 testing tools
  • Built with Java's built-in networking capabilities
  • Python implementation using asyncio for efficient async I/O

About

Some basic tools to experiment with and test IPv6

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 51.3%
  • Python 47.9%
  • Shell 0.8%
0