ping for windows and linux

本文讨论了在网络设置中遇到的问题,特别是使用静态IP地址时没有路由的情况,并提供了排查步骤,包括检查电缆、运行netstat命令、使用IP地址进行ping测试等。

On Thursday 01 December 2005 3:06 pm, David McMillan wrote:
> No route. Just a crossover Cat5.
>
> > Here are some steps you should look at:
> > 1. Make sure your cables are correct.
>
> Used the same cable for the Windows and SuSE boxes.

ok, cable, windows box, industrial box are "known good"

> > 2. run netstat -nr on your system. You should have a route to the subnet
> > and a default route. Are you using DHCP or a static IP address? netstat
> > should look sim,ilar to this.
>
> Static IP. No routes, but I'll try netstat on it anyway next chance
> I get.
>
> > 3. Are you using a name or an IP address to ping the equipment?
>
> IP. The industrial box doesn't support named access, as far as I know.

No computers support names on tcp/ip. DNS servers (software), convert names
(for humans) to IP addresses (for computers). What the reply was getting at
is that if you were pinging a name, first, ping would have to as DNS for IP,
then uses IP to do actual ping.

e.g.

brad@linux64:~/supers/mozilla> ping wtp.net
PING wtp.net (216.187.141.20) 56(84) bytes of data.
64 bytes from 180com.net (216.187.141.20): icmp_seq=1 ttl=251 time=14.7 ms
64 bytes from 180com.net (216.187.141.20): icmp_seq=2 ttl=251 time=14.7 ms

You can see the name getting converted before the ping, and used for the ping.

Anyway, that is now also known good. (We don't need DNS, you know the IP).


The only question we have then is, "Is the SuSE box known good?"

So, I'll ask. Can you / Have you been able to ping anything with that box?

Does it have internet access? (to test a ping like microsoft.com or your isp
or gateway or something)

Can you Windows box ping the SuSE box? (does it answer?)

Does the ping comand even work on the SuSE box? Can it ping itself?

e.g.

rad@linux64:~/supers/mozilla> ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.043 ms



This should narrow down the possibilities anyway.

Like someone else pointed out. Ping is a TCP/IP protocal / networking thing.

It would be like saying Windows HTML is different than Linux's HTML, or
Windows Font is different that Linux's font.

See what I mean? PING, HTML, FONTS are their own independant things, not tied
to any one OS. The software that reads, write, implements uses these
standards are tied to their OS though. But, both softwares work right, You
shouldn't be able to tell the difference between a ping from a windows box
from a ping from a linux box, from a ping from a Mac or a ping from any
othere piece of hardware (routers, etc.) Just like a person looking at html
code can't tell if the original author wrote the html on a wintel, lintel, or
mac box. You should be able to tell what printed a document with fonts on
it.... etc.


Hope this clears things up and make it easier for you.

### 如何在Windows上安装Redis 7.4.2 尽管 Redis 官方并不直接支持 Windows 平台,但在社区的努力下,仍然可以通过一些方法来安装和运行 Redis。以下是关于如何在 Windows 上安装 Redis 7.4.2 的具体说明。 #### 下载 Redis 7.4.2 由于 Redis 官方并未提供针对 Windows 的预编译二进制文件,因此需要通过第三方资源获取适合的版本。可以尝试从 GitHub 获取源码并自行编译,或者寻找由社区维护的已编译好的可执行程序[^2]。 如果选择从源码开始,则需按照以下步骤操作: 1. 使用 `wget` 命令下载 Redis 源码压缩包: ```bash wget https://github.com/redis/redis/archive/refs/tags/redis-7.4.2.tar.gz ``` 2. 解压该压缩包到目标目录: ```bash tar -xzf redis-7.4.2.tar.gz cd redis-7.4.2 ``` 3. 进入解压后的目录后,继续完成后续的编译工作[^3]。 需要注意的是,在 Windows 环境中可能无法直接利用上述 Linux 风格的工具链(如 `tar`, `make`),此时建议借助虚拟机或 WSL (Windows Subsystem for Linux) 来简化流程。 #### 创建配置文件 为了使 Redis 能够作为服务运行以及设置必要的参数,通常还需要准备一份配置文件 (`redis.conf`)。可以在任意位置新建此文件,并将其放置于合适的位置以便管理[^4]。 例如,创建一个空白的 `redis.conf` 文件: ```bash touch redis.conf ``` 随后编辑这个文件加入所需的选项,比如绑定 IP 地址、监听端口号等基本信息。 #### 启动与验证 当所有准备工作完成后,即可启动 Redis 实例。最简单的做法是在命令行界面输入如下指令: ```bash redis-server --port 6379 ``` 这将会以默认端口开启一个新的 Redis 服务进程[^5]。 对于更复杂的场景,还可以附加额外的参数调整行为模式;如果不带任何参数则会读取当前路径下的 `redis.conf` 设置来进行初始化加载。 另外也可以通过客户端工具连接至刚建立起来的服务实例进行功能测试,像发送 PING 请求确认响应状态之类的简单交互动作都是不错的选择。 --- ### 提供一段 Python 测试脚本用于检测本地 Redis 是否可用 下面给出了一段基于 Python 的代码片段用来检查是否有活动中的 Redis 服务器存在。 ```python import redis try: r = redis.StrictRedis(host='localhost', port=6379, decode_responses=True) response = r.ping() if response == 'PONG': print("Redis is running and accessible.") except Exception as e: print(f"Error connecting to Redis: {e}") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值