diff options
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 997230d..de5fa49 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -46,7 +46,7 @@ use warnings; my $dhcp_daemon = '/sbin/dhclient'; my ($eth_update, $eth_delete, $addr, $dev, $mac, $mac_update, $op_dhclient); -my ($check_name, $show_names, $intf_cli_path, $vif_name, $warn_name); +my ($check_name, $show_names, $intf_cli_path, $vif_name, $warn_name, $show_mtu); sub usage { print "Usage: $0 --dev=<interface> --check=<type>\n"; @@ -55,6 +55,7 @@ sub usage { print " $0 --dev=<interface> --eth-addr-update=<aa:aa:aa:aa:aa:aa>\n"; print " $0 --dev=<interface> --eth-addr-delete=<aa:aa:aa:aa:aa:aa>\n"; print " $0 --dev=<interface> --valid-addr={<a.b.c.d>|dhcp}\n"; + print " $0 --dev=<interface> --mtu\n"; print " $0 --show=<type>\n"; exit 1; } @@ -70,6 +71,7 @@ GetOptions("eth-addr-update=s" => \$eth_update, "show=s" => \$show_names, "vif=s" => \$vif_name, "warn" => \$warn_name, + "mtu" => \$show_mtu, ) or usage(); update_eth_addrs($eth_update, $dev) if ($eth_update); @@ -81,6 +83,7 @@ op_dhcp_command($op_dhclient, $dev) if ($op_dhclient); is_valid_name($check_name, $dev) if ($check_name); exists_name($dev) if ($warn_name); show_interfaces($show_names) if ($show_names); +show_mtu($dev) if ($show_mtu); exit 0; sub is_ip_configured { @@ -152,6 +155,12 @@ sub get_mtu { return $intf->mtu(); } +sub show_mtu { + my $name = shift; + my $mtu = get_mtu($name); + print "$mtu\n" if $mtu; +} + sub dhcp_update_config { my ($conf_file, $intf) = @_; |