Freebsd下如何修改网卡属性

Freebsd下修改100M/1000M自适应网卡为百兆

首先,# cd /etc 进入到etc目录下
     # ls
 PG.conf                 ftpusers                manpath.config          pf.os                   rc.subr
 amd.map                 gettytab                master.passwd           phones                  rc.suspend
 apmd.conf               group                   mdetc                   portsnap.conf           remote
 auth.conf               host.conf               motd                    printcap                rpc
 crontab                 hostid                  mtree                   profile                 services
 csh.cshrc               hosts                   netconfig               protocols               shells
 csh.login               hosts.allow             netstart                pwd.db                  snmpd.config
 csh.logout              hosts.equiv             network.subr            rc                      spwd.db
 ddb.conf                hosts.lpd               networks                rc.bsdextended          ssh
 defaults                inetd.conf              newsyslog.conf          rc.conf                 ssl
 devd.conf               libalias.conf           nscd.conf               rc.d                    sysctl.conf
 devfs.conf              localtime               nsmb.conf               rc.firewall             syslog.conf
 dhclient.conf           locate.rc               nsswitch.conf           rc.firewall6            termcap
 disktab                 login.access            opieaccess              rc.initdiskless         ttys
 dumpdates               login.conf              opiekeys                rc.local
 fbtab                   login.conf.db           pam.d                   rc.resume
 freebsd-update.conf     mac.conf                passwd                  rc.sendmail
 fstab                   mail.rc                 pccard_ether            rc.shutdown
 
找到rc.conf 文件,使用vi命令修改此配置文件,增加以下内容:
ifconfig_bge0="inet media 100baseTX mediaopt full-duplex"
ifconfig_bce0="inet media 100baseTX mediaopt full-duplex"
ifconfig_bce1="inet media 100baseTX mediaopt full-duplex"

保存退出。
至此,100M/1000M自适应网卡已修改为百兆网卡并且为全双工模式。
修改 rc.conf 配置文件的目的是保证机器重启后网卡属性保持不变。
如果仅需要调试可以在命令行输入: ifconfig bge0 media 100BaseTX mediaopt full-duplex 即可

你可能感兴趣的:(职场,FreeBSD,休闲,网卡模式)