Index: etc/network.subr =================================================================== RCS file: /private/FreeBSD/src/etc/network.subr,v retrieving revision 1.156 diff -u -p -r1.156 network.subr --- etc/network.subr 28 Aug 2004 07:58:02 -0000 1.156 +++ etc/network.subr 28 Oct 2004 07:59:34 -0000 @@ -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 } Index: etc/rc.d/netif =================================================================== RCS file: /private/FreeBSD/src/etc/rc.d/netif,v retrieving revision 1.11 diff -u -p -r1.11 netif --- etc/rc.d/netif 7 Oct 2004 13:55:26 -0000 1.11 +++ etc/rc.d/netif 28 Oct 2004 07:50:14 -0000 @@ -56,6 +56,9 @@ network_start() # Create IPv6<-->IPv4 tunnels gif_up + + # Rename interfaces. + ifnet_rename fi # Configure the interface(s). Index: etc/defaults/rc.conf =================================================================== RCS file: /private/FreeBSD/src/etc/defaults/rc.conf,v retrieving revision 1.214 diff -u -p -r1.214 rc.conf --- etc/defaults/rc.conf 15 Sep 2004 01:08:32 -0000 1.214 +++ etc/defaults/rc.conf 27 Oct 2004 17:59:48 -0000 @@ -128,6 +128,7 @@ cloned_interfaces="" # List of cloned n ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. +#ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. # # If you have any sppp(4) interfaces above, you might also want to set # the following parameters. Refer to spppcontrol(8) for their meaning. Index: share/man/man5/rc.conf.5 =================================================================== RCS file: /private/FreeBSD/src/share/man/man5/rc.conf.5,v retrieving revision 1.222 diff -u -p -r1.222 rc.conf.5 --- share/man/man5/rc.conf.5 15 Sep 2004 01:39:25 -0000 1.222 +++ share/man/man5/rc.conf.5 27 Oct 2004 18:02:54 -0000 @@ -932,6 +932,12 @@ it is possible to use something like: .Bd -literal ifconfig_ed0="DHCP" .Ed +.Pp +It is also possible to rename interface by doing: +.Bd -literal +ifconfig_ed0_name="net0" +ifconfig_net0="inet 10.0.0.1 netmask 0xffff0000" +.Ed .It Va ipv6_network_interfaces .Pq Vt str This is the IPv6 equivalent of