---
name: "Rex::Commands::Network"
section: "3pm"
platform: "linux"
package: "rex"
version: "1.16.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Rex::Commands::Network"
---

# Rex::Commands::Network(3pm)

Network Module

## NAME

Rex::Commands::Network - Network Module

## DESCRIPTION

With this module you can get information of the routing table, current network connections, open ports, ...

## SYNOPSIS

```
 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;
```

## EXPORTED FUNCTIONS

### route

Get routing information

### default\_gateway(\[$default\_gw\])

Get or set the default gateway.

### netstat

Get network connection information
