2

My server has multiple /24 subnets added via network-script files ifcfg-eth0-range0

Now one /24 subnet has connection issues and I need to perform a traceroute to see what's wrong.

How can I have my server using one of those IPs as outgoing IP address when doing a traceroute?

maddo7
  • 165

2 Answers2

2

I imagine your subnets are assigned to (virtual) interfaces and that you want the trace to go through one of these.

The traceroute has an option for this. Check out the man page - you just do this to force the trace to proceed through a specific interface:

traceroute -i <interface> <host>

If this doesn't work, out can add a specific route to the host you want to trace via the gateway you want. Do:

route add -host <host> gw <gw>

Then do the traceroute - and don't forget to delete the route (if you don't need it anymore):

route del -host <host> gw <gw>

Hope it helps.

MrMajestyk
  • 1,078
0

I know this is very old but you can accomplish what you need by using:

traceroute -s source_IP (the ip on that specific interface) destination