5

I am trying to use ping with specified interface with a command

ping -I re3 192.168.1.1

I know re3 exists from ifconfig

re3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether e8:de:27:01:7f:e7
        inet6 fe80::eade:27ff:fe01:7fe7%re3 prefixlen 64 scopeid 0x4
        inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

Unfortunately I can't ping it's gateway:

$/root: ping -I re3 192.168.1.1
ping: invalid multicast interface: `re3'

What that mean?

UPDATE

$arp 192.168.1.1
? (192.168.1.1) at (incomplete) on re3 expired [ethernet]
6

On FreeBSD and macos the -I flag does not behave as one would expect from Linux. If you check the man page carefully, you'll see:

 -I iface
        Source multicast packets with the given interface **address**.

[emphasis mine]

So the -I flag actually expects an address, not an interface. You can confirm with something like:

$ ping -I 192.168.1.2 192.168.1.1

But unless your target IP address is a multicast address this will still fail.

To get the behaviour we all know and expect from traceroute and Linux, use the -S flag instead and specify the IP address of the interface you want to use:

$ ping -S 192.168.1.2 192.168.1.1
PING 192.168.1.1 (192.168.1.1) from 192.168.1.20: 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=5.956 ms
4

Not much experience in freebsd system, as far as i know for ping try:

ping -S 192.168.1.2 192.168.1.1

As for arp

  • If arp cant fetch mac address of your gateway then freebsd server lost it's connectivity with the gateway.
  • Check whether gateway of your server is UP/RUNNING, and also check the physical connectivty of both.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.