Specify Source IP on Linux Command

It is a very desirable function if you could specify source IP ( source Port will be extra useful) for network testing and debugging. Here is a short list of command syntax for commonly used tools in Linux curl curl http://10.101.26.104 --interface 6.7.8.9 --local-port 23456 dig dig jian.p1.tps.a10lab.com @7.7.7.1 -b 50.35.26.100#23456 wget wget --bind-address=6.7.8.9 http://10.101.26.104 wget could not specify source port; but you could use the following trick to limit the source ports used in Linux: check the config of file /proc/sys/net/ipv4/ip_local_port_range cat /proc/sys/net/ipv4/ip_local_port_range 32768 60999 By default the source ports ranges from 32678 to 60999 change the file to limit to one source port echo "23456 23456" > /proc/sys/net/ipv4/ip_local_port_range Then test again, your wget command will use source port 23456 nslookup Does not have any option...