欢迎您来到悍铭数据中心,开始互联网之旅!

新闻中心

make the network configuration easy more.

 Unlike linux, the netcard's name of freebsd is various. Why not make it simple? Try the patch. After patch, every physical netcard will be named like "eth0", "eth1".
diff -ruN sys/net/if_ethersubr.c sys/net/if_ethersubr.c.orig
--- sys/net/if_ethersubr.c    Tue May 24 13:14:42 2005
+++ sys/net/if_ethersubr.c.orig    Tue May 24 13:14:32 2005
@@ -828,8 +828,6 @@
 /*
  * Perform common duties while attaching to interface list
  */
-static int unit = 0;
-char *ifname = "eth"; 
 void
 ether_ifattach(ifp, bpf)
     register struct ifnet *ifp;
@@ -838,8 +836,6 @@
     register struct ifaddr *ifa;
     register struct sockaddr_dl *sdl;
 
-    ifp->if_name = ifname;
-    ifp->if_unit = unit++;
     ifp->if_type = IFT_ETHER;
     ifp->if_addrlen = 6;
     ifp->if_hdrlen = 14;
 

香港云主机