要在Linux系统中ping网关,可以使用ping命令。在终端中输入以下命令:
```
ping <网关IP地址>
```
例如,如果网关的IP地址为192.168.1.1,可以输入以下命令:
```
ping 192.168.1.1
```
系统将发送ICMP Echo Request消息到网关,并等待回复。如果网关可达,你将在终端中看到类似以下内容的输出:
```
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.404 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.203 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.220 ms
```
如果网关不可达,你将看到类似以下内容的输出:
```
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.0.1 icmp_seq=1 Destination Host Unreachable
From 192.168.0.1 icmp_seq=2 Destination Host Unreachable
From 192.168.0.1 icmp_seq=3 Destination Host Unreachable
```
你可以使用Ctrl+C键来停止ping命令的执行。