T
T
Thiago Alvarez2018-12-16 16:26:40
linux
Thiago Alvarez, 2018-12-16 16:26:40

How to ping from a specific interface if there are several interfaces?

How to ping from a specific interface if there are several interfaces?
costs Linux ubuntu server and after configuring the isc dhcp server, for some reason I started pinging from a different interface.
that is, eth0 looks at the local network, and eth1 looks at the router.
I want to ping a computer in LAN, but Destination Host Unreachable, since icmp is sent from eth1
How can I change it? what file to configure? or what?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
ky0, 2018-12-16
@ky0

Packets are sent according to the routing table. If you want to go through another interface - add the appropriate route. If there are multiple addresses on the same interface, ping has a key -Ito manually specify which address to send from.

R
Rsa97, 2018-12-16
@Rsa97

# man ping

-I адрес
    Установить адрес источника в указанный. В качестве аргумента
    может выступать числовой IP-адрес или имя устройства.

N
nano_e_t_4, 2018-12-16
@nano_e_t_4

ping -I "desired interface" 192.168.0.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question