背景:如果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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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 <full-duplex>)
status: active
dc1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
tun0: flags=8010<POINTOPOINT,MULTICAST> 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
1、运行命令ifconfig查看当前网卡列表,确定名称,如果不在列表内,可能是驱动没装好
% ifconfig
dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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 <full-duplex>)
status: active
dc1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
tun0: flags=8010<POINTOPOINT,MULTICAST> 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
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/8449/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2016-1-19 22:49
评论列表