更改网路设定
如何更换网卡
可以察看硬体支援列表,也可以查询核心原始码来得知网卡是否支援
如果在 FreeBSD 支援之列, 就能够清楚网卡的代号,而且目前核心有抓到可以下 ifconfig
-a
xl0: flags=........... ......................
sis0: flags=........... ......................
fxp0: flags=.......... ......................
vr0: flags=........... ......................
ed0: flags=........... ......................
rl0: flags=........... ......................
de0: flags=...........
......................
上面那些红色的部份即是 网卡(InterFace) 的代号
例如:
原来用的是 D-Link 530 TX (vr0) 换成 Intel (fxp0)
修改网卡设定,vi /etc/rc.conf
找 ifconfig_vr0="inet ..... 那行 换成 ifconfig_fxp0="inet .....
如何换 IP 或是主机名称
假设原来用的网卡是 fxp0 (Intel) IP 为 192.168.168.2 名称为 abc.ks.edu.tw
想换成 IP: 192.168.168.4 名称: def.ks.edu.tw
必须要修改: /etc/rc.conf /etc/hosts
下指令:
vi /etc/rc.conf
把 ifconfig_fxp0="inet 192.168.168.2 netmask
255.255.255.0"
换成 ifconfig_fxp0="inet 192.168.168.4 netmask
255.255.255.0"
把 hostname="abc.ks.edu.tw 换成 hostname="def.ks.edu.tw
下指令:
vi /etc/hosts
把 192.168.168.2 abc.ks.edu.tw abc 192.168.168.2
abc.ks.edu.tw.
换成 192.168.168.4 def.ks.edu.tw
192.168.168.4 def.ks.edu.tw.
如果想马上生效就下
1.arp -da
2.route -n flush
3./etc/netstart
或者: 重新开机(reboot)