vintage_net v0.7.7 VintageNet.Route.IPRoute View Source
This module knows how to invoke the ip
command to modify the Linux routing tables
Link to this section Summary
Functions
Add a default route
Add a local route
Add a source IP address -> routing table rule
Clear one local route generically
Clear one local route
Clear one default route out of the main table for any interface
Clear one default route that goes to the specified interface
Clear out one rule
Clear all routes on all interfaces
Clear all rules that select the specified table or tables
Link to this section Functions
add_default_route(ifname, route, metric, table_index)
View Sourceadd_default_route( VintageNet.ifname(), :inet.ip_address(), VintageNet.Route.Calculator.metric(), VintageNet.Route.Calculator.table_index() ) :: :ok | {:error, any()}
Add a default route
add_local_route(ifname, ip, subnet_bits, metric, table_index)
View Sourceadd_local_route( VintageNet.ifname(), :inet.ip_address(), VintageNet.prefix_length(), VintageNet.Route.Calculator.metric(), VintageNet.Route.Calculator.table_index() ) :: :ok | {:error, any()}
Add a local route
add_rule(ip_address, table_index)
View Sourceadd_rule(:inet.ip_address(), VintageNet.Route.Calculator.table_index()) :: :ok | {:error, any()}
Add a source IP address -> routing table rule
clear_a_local_route(ifname)
View Sourceclear_a_local_route(VintageNet.ifname()) :: :ok | {:error, any()}
Clear one local route generically
clear_a_local_route(ifname, ip, subnet_bits, metric, table_index)
View Sourceclear_a_local_route( VintageNet.ifname(), :inet.ip_address(), VintageNet.prefix_length(), VintageNet.Route.Calculator.metric(), VintageNet.Route.Calculator.table_index() ) :: :ok | {:error, any()}
Clear one local route
Clear one default route out of the main table for any interface
clear_a_route(ifname, table_index \\ :main)
View Sourceclear_a_route(VintageNet.ifname(), VintageNet.Route.Calculator.table_index()) :: :ok | {:error, any()}
Clear one default route that goes to the specified interface
clear_a_rule(table_index)
View Sourceclear_a_rule(VintageNet.Route.Calculator.table_index()) :: :ok | {:error, any()}
Clear out one rule
Clear all routes on all interfaces
clear_all_rules(table_index)
View Sourceclear_all_rules(VintageNet.Route.Calculator.table_index() | Enumerable.t()) :: :ok
Clear all rules that select the specified table or tables