scapy.route

网络接口的路由和处理.

class scapy.route.Route

Bases: object

add(*args, **kargs)

例如:添加(net =" 192.168.1.0/24",gw =" 1.2.3.4")

delt(host|net, gw|dev)
get_if_bcast(iff)
ifadd(iff, addr)
ifchange(iff, addr)
ifdel(iff)
invalidate_cache()
make_route(host=None, net=None, gw=None, dev=None, metric=1)
resync()
route(dst=None, verbose=2)

返回到主机的IPv4路由. :param-dst:目标主机的IPv4

returns: (iface, output_ip, gateway_ip)
  • iface:用于连接主机的接口

  • output_ip:将使用的传出IP

  • gateway_ip:将使用的网关IP