标题:[实践OK]freebsd网卡安装与dhcp配置方法 出处:向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除 时间:Tue, 19 Jan 2016 22:45:47 +0000 作者:jackxiang 地址:http://jackxiang.com/post/8449/ 内容: 背景:如果FreeBSD安装在vmware里,想上网,那么Vmware8及nat模式想上网,那么dhcp分配IP是难免的。在笔记本用wifi上网那个网卡共享给Vmware8后,vmware8会有一个IP 192.168.137.1 ,经过上面配置后FreeBSD获得IP是 192.168.137.129,没有curl,用ping一个就能获取到IP说明初步成功,但能否上外网和dns有关。 1、运行命令ifconfig查看当前网卡列表,确定名称,如果不在列表内,可能是驱动没装好 % ifconfig dc0: flags=8843 mtu 1500 inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255 ether 00:a0:cc:da:da:da media: Ethernet autoselect (100baseTX ) status: active dc1: flags=8843 mtu 1500 inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255 ether 00:a0:cc:da:da:db media: Ethernet 10baseT/UTP status: no carrier lp0: flags=8810 mtu 1500 lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 tun0: flags=8010 mtu 1500 2、vi /etc/rc.conf 添加 ifconfig_dc0="DHCP" dhcp_program="/sbin/dhclient" dhcp_flags="" 3、reboot后,应该就可以用了 来自:http://www.jb51.net/article/15810.htm Generated by Jackxiang's Bo-blog 2.1.1 Release