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

FreeBSD freebsd 13.0-RELEASE

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

1.下载源码

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

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

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

1
2
/usr/src/dev/igc
/usr/src/modules/igc

4.挂载U盘到系统

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

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

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

6.编译驱动

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

7.配置网络

1
2
3
4
5
6
让系统自动加载
ee /boot/loader.conf
if_igc_load="YES"
配置连接方式
ee /etc/rc.conf
ifconfig_igc0="DHCP"

8.完成

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
------ 本文结束------