No "-I" (capital `i`) flag in traceroute

The standard traceroute package lacks the "-I" flag, which would cause the utility to send ICMP packets instead of UDP. This flag exists in traceroute packages for other operating systems (Debian, Ubuntu, etc.). Is there any way to install an extended package that includes this flag? Please refrain from suggesting using MTR.

Hping3 will allow using icmp... but the default busybox traceroute does not have icmp tracing enabled as far as I can tell. If you need it, you likely can build your own firmware enabling that feature for busybox.

you'll need the full version. This should build it an override busybox ..

package/utils/traceroute/Makefile
include $(TOPDIR)/rules.mk

PKG_NAME:=traceroute
PKG_VERSION:=2.1.6
PKG_RELEASE:=1

# Use the direct SourceForge download link to bypass broken OpenWrt mirrors
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.sourceforge.net/traceroute/
PKG_HASH:=9ccef9cdb9d7a98ff7fbf93f79ebd0e48881664b525c4b232a0fcec7dcb9db5e

PKG_MAINTAINER:=OpenWrt Developer
PKG_LICENSE:=GPL-2.0-or-later

include $(INCLUDE_DIR)/package.mk

define Package/traceroute
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=Traceroute (full version with -I/ICMP support)
  DEPENDS:=+libc
  # This line tells the system to override BusyBox
  ALTERNATIVES:=100:/usr/bin/traceroute:/usr/bin/traceroute-full
endef

define Package/traceroute/description
 This is the full implementation of the traceroute(8) utility for Linux.
 Unlike the BusyBox version, it supports ICMP (-I) and TCP (-T) tracing.
endef

# The upstream Makefile needs a few tweaks for cross-compiling
define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR) \
		CC="$(TARGET_CC)" \
		CFLAGS="$(TARGET_CFLAGS)" \
		LDFLAGS="$(TARGET_LDFLAGS)"
endef

define Package/traceroute/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/traceroute/traceroute $(1)/usr/bin/traceroute-full
endef

$(eval $(call BuildPackage,traceroute))

I have confirmed it builds ...the rest is up to you

2 Likes

It works! Thank you so much!

1 Like