您的位置:首页 > 理论基础 > 计算机网络

FreeBSD菜鸟入门手迹(1)--配置网络连接

2011-04-14 14:01 351 查看
设置静态IP

临时性的:ifconfig em0 192.168.1.1 netmask 255.255.255.0 (说明:em0是第一块千兆网卡)

永久的:编辑vi /etc/rc.conf 添加如下内容:

ifconfig_fxp0=”inet 192.168.8.8 netmask 255.255.255.0”

defaultrouter=”192.168.8.10”

手动添加DNS,编辑/etc/resolv.conf 文件,如果没有可以手动创建touch reslov.conf 在其中添加nameserver 202.121.241.8

配置完成之后sh /etc/rc 使配置生效!

设置动态IP:编辑 vi /etc/rc.conf 添加如下内容

ifconfig_dc0="DHCP"

dhcp_program="/sbin/dhclient"

dccp_flags=""

重启生效reboot
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: