Rex::C...etwork(3pm)

πŸ’– Rex::Commands::Network πŸ’–

okay bestie, so this is Rex::Commands::Network, a lil Perl module from the User Contributed Perl Documentation collection (section 3pm, we love a classic) ✨ she's a whole vibe for anyone who's ever needed to peek at what the network is doing πŸ‘‘


🌸 NAME 🌸

Rex::Commands::Network β€” it's literally the Network Module, no cap πŸ’… that's the whole name, that's the whole job.


πŸ¦‹ DESCRIPTION πŸ¦‹

so with this module you can get info about the routing table, your current network connections, open ports, ... and like, all the rest of that good stuff 🌈

basically: it's the gossip column for your network. it knows where your packets are going and it's not afraid to say it 🫢


✨ SYNOPSIS ✨

here's the whole thing in action, copy-paste energy, iconic:

use Rex::Commands::Network;

my @routes = route;
print Dumper(\@routes);

my $default_gw = default_gateway;
default_gateway "192.168.2.1";

my @netstat = netstat;
my @tcp_connections = grep { $_->{"proto"} eq "tcp" } netstat;

not me reading that and immediately going "oh she ATE" πŸ”₯ look at her getting routes AND setting a gateway AND filtering tcp connections, main character behaviour fr fr πŸ’œ


πŸ’… EXPORTED FUNCTIONS πŸ’…

πŸŽ€ route

Get routing information 🌸

like, just... route. that's it. she gives you the routing info and you say thank you 🫢

πŸŽ€ default_gateway([$default_gw])

Get or set the default gateway. both! a dual threat, obsessed 😭✨

call her with no args and she gets it β€” call her with $default_gw and she sets it. versatile queen πŸ‘‘

πŸŽ€ netstat

Get network connection information πŸ’–

all your connections, right there, ready for you to grep through like the little detective you are πŸ”πŸ‘‘


ngl bestie, that's the whole module. no hidden options, no flags, no secret lore πŸ¦‹ just three functions being cute and useful at the same time. the way that's possible?? unbelievable πŸ’€

and that's a wrap on Rex::Commands::Network πŸŒˆπŸ’– this lil page lives in perl v5.40.1 and got her lil glow-up on 2025-10-03 ✨ so when you're out here slaying with route, default_gateway and netstat, just remember her, okay? she did that πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from