LinuxCommandLibrary

ping6.py

Ping IPv6 network hosts

TLDR

Ping an IPv6 host from a specified source IPv6 address

$ ping6.py [source_ipv6] [destination_ipv6]
copy

Ping 2001:db8::2 from 2001:db8::1
$ ping6.py 2001:db8::1 2001:db8::2
copy

SYNOPSIS

ping6.py [-c count] [-i interval] [-s packetsize] destination

PARAMETERS

-c count
    Stop after sending count ECHO_REQUEST packets. If not specified, ping operates until interrupted.

-i interval
    Wait interval seconds between sending each packet. The default is one second. The minimum interval allowed for non-super-users is 0.2 seconds.

-s packetsize
    Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.

destination
    The IPv6 address to ping.

DESCRIPTION

The ping6.py command is a Python script that emulates the functionality of the standard ping utility, specifically for testing IPv6 network connectivity. It sends ICMPv6 Echo Request packets to a specified destination IPv6 address and waits for ICMPv6 Echo Reply packets in response. This allows users to determine if a host is reachable, and to measure the round-trip time (RTT) of network packets. The script uses raw sockets to construct and send ICMPv6 packets, offering a low-level approach to network diagnostics. This provides more flexibility but also needs root priviliges.

Note that ping6 might be a native binary and not a python script depending on the distribution. Use which ping6 to find out if ping6 is a script. If it is a script you can use less `which ping6` to check for the contents.

CAVEATS

Requires root privileges to run due to the use of raw sockets. Script might not perfectly replicate all features of standard ping6 implementations. The script's behavior and output format might differ slightly depending on the distribution and exact implementation. This script has no warranty. Use at your own risk.

DEPENDENCIES

The ping6.py script relies on the Python programming language and standard libraries like socket and struct. No additional external libraries are typically required.

SECURITY CONSIDERATIONS

Using raw sockets requires careful handling of packet construction and interpretation to avoid potential security vulnerabilities. Malformed packets could potentially be exploited. Ensure proper validation of input parameters to mitigate risks.

SEE ALSO

ping(8), traceroute6(8), netstat(1)

Copied to clipboard