diff options
author | pjd <pjd@FreeBSD.org> | 2004-10-30 13:44:06 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-10-30 13:44:06 +0000 |
commit | 99334313420dd90c7d7f5cc6dac1a292b472001f (patch) | |
tree | 8b33932a48beb2cd86ecc804ea6123b37da7fcc4 /etc/network.subr | |
parent | ae417ad6eff174e3deea727e7b5be16491f4cf7a (diff) | |
download | FreeBSD-src-99334313420dd90c7d7f5cc6dac1a292b472001f.zip FreeBSD-src-99334313420dd90c7d7f5cc6dac1a292b472001f.tar.gz |
Allow to change interfaces name on boot time.
Now, one should be able to put something like this into /etc/rc.conf:
ifconfig_fxp0_name="net0"
ifconfig_net0="inet 10.0.0.1/16"
Reviewed by: green
Diffstat (limited to 'etc/network.subr')
-rw-r--r-- | etc/network.subr | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/etc/network.subr b/etc/network.subr index b413e01..090f847 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -250,6 +250,23 @@ ipx_down() return $_ret } +# ifnet_rename +# Rename all requested interfaces. +# +ifnet_rename() +{ + + _ifn_list="`list_net_interfaces all`" + [ -z "$_ifn_list" ] && return 0 + for _if in ${_ifn_list} ; do + eval _ifname=\$ifconfig_${_if}_name + if [ ! -z "$_ifname" ]; then + ifconfig $_if name $_ifname + fi + done + return 0 +} + # # list_net_interfaces type # List all network interfaces. The type of interface returned @@ -257,6 +274,7 @@ ipx_down() # argument can be any of the following: # nodhcp - all interfaces, excluding DHCP configured interfaces # dhcp - list only DHCP configured interfaces +# all - all interfaces # If no argument is specified all network interfaces are output. # Note that the list will include cloned interfaces if applicable. # Cloned interfaces must already exist to have a chance to appear @@ -325,6 +343,9 @@ list_net_interfaces() dhcp) echo $_dhcplist ;; + all) + echo $_nodhcplist $_dhcplist + ;; esac return 0 } |