FreeBSD 13.0-Release Add IGC Driver (Intel I225-V Network Adapter)

By | 2021-11-26

FreeBSD freebsd 13.0-RELEASE

手动编译igc驱动,并添加到系统

1、 下载源码

freebsd/freebsd-src: FreeBSD src tree (read-only mirror) (github.com)

2、格式化一个FAT32格式的U盘

3、将下载好的igc驱动代码放入U盘

复制这两个文件夹到U盘
/usr/src/dev/igc
/usr/src/modules/igc

4、挂载U盘到FreeBSD

FreeBSD会将USB挂载为SCSI设备,在/dev目录可查看,这里U盘名为da0
查看U盘信息	gpart show da0
查看U盘格式	fstyp da0p1,这里是msdosfs
新建文件夹	mkdir /mnt/usb
挂载U盘到文件夹	mount_msdosfs /dev/da0p1 /mnt/usb

5、将驱动文件复制到源码目录

cp -rf /mnt/usb/dev/igc /usr/src/dev/igc
cp -rf /mnt/usb/modules/igc /usr/src/modules/igc

6、编译驱动

cd /usr/src/sys/modules/igc
编译
make
搜索生成的驱动文件
find / -name if_igc.ko
将if_igc.ko复制到安装目录
/boot/modules/if_igc.ko
加载驱动
kldload if_igc (重启失效)

7、配置网络

让系统自动加载(永久生效)
ee /boot/loader.conf
if_igc_load="YES"
配置连接方式
ee /etc/rc.conf
ifconfig_igc0="DHCP"

8、驱动添加完成

uname -a
FreeBSD freebsd 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

pciconf -lv
...
igc0@pci0:1:0:0:	class=0x020000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x15f3 subvendor=0x8086 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Controller I225-V'
    class      = network
    subclass   = ethernet
igc1@pci0:2:0:0:	class=0x020000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x15f3 subvendor=0x8086 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Controller I225-V'
    class      = network
    subclass   = ethernet
nvme0@pci0:3:0:0:	class=0x010802 rev=0x03 hdr=0x00 vendor=0x126f device=0x2263 subvendor=0x126f subdevice=0x2263
    vendor     = 'Silicon Motion, Inc.'
    device     = 'SM2263EN/SM2263XT SSD Controller'
    class      = mass storage
    subclass   = NVM

ifconfig igc0
igc0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=4e527bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,WOL_MAGIC,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,NOMAP>
	ether 00:a0:c9:00:00:0a
	inet 192.168.8.193 netmask 0xffffff00 broadcast 192.168.8.255
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

ping www.baidu.com

PING www.a.shifen.com (14.215.177.38): 56 data bytes
64 bytes from 14.215.177.38: icmp_seq=0 ttl=56 time=6.775 ms
64 bytes from 14.215.177.38: icmp_seq=1 ttl=56 time=6.860 ms
64 bytes from 14.215.177.38: icmp_seq=2 ttl=56 time=5.945 ms
64 bytes from 14.215.177.38: icmp_seq=3 ttl=56 time=6.736 ms
64 bytes from 14.215.177.38: icmp_seq=4 ttl=56 time=6.511 ms
64 bytes from 14.215.177.38: icmp_seq=5 ttl=56 time=6.360 ms

--- www.a.shifen.com ping statistics ---
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 5.945/6.531/6.860/0.312 ms

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注