eth1
대상에서 인식되는 USB-이더넷 어댑터를 사용합니다 . 그런 다음 eth1
명령을 사용하기 위해 IP를 설정했습니다.
ifconfig eth1 YY.YY.YY.YY
내가 사용할 때
ping -I eth1 XX.XX.XX.XX
산출:
mx6q:~# ping -I eth1 192.168.2.35
PING 192.168.2.35 (192.168.2.35): 56 data bytes
^C
--- 192.168.2.35 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss
작동하지 않고 사용할 때
ping -I YY.YY.YY.YY XX.XX.XX.XX
산출:
mx6q:~# ping -I 192.168.2.99 192.168.2.35
PING 192.168.2.35 (192.168.2.35) from 192.168.2.99: 56 data bytes
64 bytes from 192.168.2.35: seq=0 ttl=64 time=0.765 ms
64 bytes from 192.168.2.35: seq=1 ttl=64 time=0.437 ms
^C
--- 192.168.2.35 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
그것예피복재.
인터페이스 이름을 통해 핑하는 방법은 무엇입니까?
IF 구성
eth1 Link encap:Ethernet HWaddr 00:07:40:53:dd:1b
inet addr:192.168.2.99 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::207:40ff:fe53:dd1b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4754 (4.6 KiB) TX bytes:1376 (1.3 KiB)
답변1
인터페이스 이름이 컴퓨터에 존재하는지 확인하십시오. ifconfig
또는 ip addr show
또는 명령을 실행하여 ip link show
확인하십시오 .
일부 문제 해결을 위해 ip route show
및 명령을 사용할 수도 있습니다 .traceroute -i
작동 원리는 아래 그림에 나와 있습니다.
[iahmad@ijaz-cms ~]$ ping -I enp0s25 www.google.com
PING www.google.com (172.217.18.100) from 137.138.52.207 enp0s25: 56(84) bytes of data.
64 bytes from zrh04s05-in-f4.1e100.net (172.217.18.100): icmp_seq=1 ttl=54 time=4.88 ms
64 bytes from zrh04s05-in-f4.1e100.net (172.217.18.100): icmp_seq=2 ttl=54 time=4.97 ms
64 bytes from zrh04s05-in-f4.1e100.net (172.217.18.100): icmp_seq=3 ttl=54 time=5.01 ms
^C
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 4.885/4.958/5.019/0.055 ms
[iahmad@ijaz-cms ~]$ ping -I 137.138.52.207 www.google.com
PING www.google.com (172.217.18.100) from 137.138.52.207 : 56(84) bytes of data.
64 bytes from zrh04s05-in-f4.1e100.net (172.217.18.100): icmp_seq=1 ttl=54 time=4.98 ms
64 bytes from zrh04s05-in-f4.1e100.net (172.217.18.100): icmp_seq=2 ttl=54 time=4.93 ms
64 bytes from zrh04s05-in-f4.1e100.net (172.217.18.100): icmp_seq=3 ttl=54 time=4.96 ms
64 bytes from zrh04s05-in-f4.1e100.net (172.217.18.100): icmp_seq=4 ttl=54 time=4.98 ms
^C
--- www.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 4.939/4.966/4.983/0.017 ms