Outils pour utilisateurs

Outils du site


bsd:bsdnet

Configuration réseaux Command Line

FreeBSD


Découvrir le type de carte réseaux reconnue par le kernel

pciconf -lvc
 
nfe0@pci0:0:10:0:	class=0x020000 card=0x82e21043 chip=0x076010de rev=0xa2 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'MCP77 Ethernet'
    class      = network
    subclass   = ethernet
    cap 01[44] = powerspec 2  supports D0 D1 D2 D3  current D0
    cap 05[50] = MSI supports 16 messages, 64 bit, vector masks 
    cap 08[6c] = HT MSI fixed address window disabled at 0xfee00000
 
re0@pci0:1:11:0:	class=0x020000 card=0x816910ec chip=0x816910ec rev=0x10 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8169 PCI Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
    cap 01[dc] = powerspec 2  supports D0 D1 D2 D3  current D0

vendor = constructeur
device = modèle

On découvre deux cartes réseaux prisent en charge:

  • par le driver nfe0
    • port: pci0:0:10:0:
    • signature de la carte: card=0x82e21043
    • signature du chipset: chip=0x076010de
    • vendor = 'NVIDIA Corporation'
    • device = 'MCP77 Ethernet'
  • par le driver re0
    • port: pci0:1:11:0:
    • signature de la carte: card=0x816910ec
    • signature du chipset: chip=0x816910ec
    • vendor = 'Realtek Semiconductor Co., Ltd.'
    • device = 'RTL8169 PCI Gigabit Ethernet Controller'
pciconf -lvc | grep Ethernet
    device     = 'MCP77 Ethernet'
    device     = 'RTL8169 PCI Gigabit Ethernet Controller'


Charger le driver par le kernel au démarrage de la machine

vim /boot/loader.conf
if_nfe_load="YES"

J'ai fait cela car j'avais des problèmes de DUP ! pour duplication d'adresse ip lors de la commande ping.
Actuellement je vais contrôler si en passant par le modules j'ai encore ce type de problème.

ping -c 100 192.168.1.12
PING 192.168.1.12 (192.168.1.12) 56(84) bytes of data.
64 bytes from 192.168.1.12: icmp_seq=1 ttl=64 time=227 ms
From 192.168.1.54 icmp_seq=1 Redirect Network(New nexthop: 12.1.168.192)
64 bytes from 192.168.1.12: icmp_seq=1 ttl=64 time=228 ms (DUP!)
64 bytes from 192.168.1.12: icmp_seq=2 ttl=64 time=5.13 ms
64 bytes from 192.168.1.12: icmp_seq=2 ttl=64 time=5.26 ms (DUP!)
64 bytes from 192.168.1.12: icmp_seq=3 ttl=64 time=1.05 ms
From 192.168.1.54 icmp_seq=3 Redirect Network(New nexthop: 12.1.168.192)
64 bytes from 192.168.1.12: icmp_seq=3 ttl=64 time=2.00 ms (DUP!)
64 bytes from 192.168.1.12: icmp_seq=4 ttl=64 time=1.08 ms
From 192.168.1.54 icmp_seq=4 Redirect Network(New nexthop: 12.1.168.192)
64 bytes from 192.168.1.12: icmp_seq=4 ttl=64 time=1.88 ms (DUP!)
^C
--- 192.168.1.12 ping statistics ---
4 packets transmitted, 4 received, +4 duplicates, +3 errors, 0% packet loss, time 3004ms

Erreurs possibles:

  • driver pas complètement pris en charge par le Kernel Generic
    • fait cela n'a rien changé, l'erreur revient encore
  • câble UTP défaillant
  • carte défaillante


Configurer l'ip par la CLI

  • par la ligne de commande (exemple avec une carte réseau nfe0)
ifconfig nfe0 192.168.1.10 broadcast 192.168.1.255 netmask 255.255.255.0 up
  • ajouter la gateway
route add default 192.168.1.254
  • ajouter les dns
echo -e "search home.lan\nnameserver 208.67.222.222\nnameserver 208.67.220.220" > /etc/resolv.conf


Pour que ce soit permanent après un restart

vim /etc/rc.conf
ifconfig_nfe0="inet 192.168.1.12 netmask 255.255.255.0"
ifconfig_re0="inet 192.168.1.13 netmask 255.255.255.0" (si deuxième carte réseaux)
defaultrouter="192.168.1.254"
vim /etc/resolv.conf
search home.lan
nameserver 208.67.222.222
nameserver 208.67.220.220


Vérifier la vitesse

ifconfig 
re0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
	ether 00:08:54:57:d9:fc
	inet 192.168.1.13 netmask 0xffffff00 broadcast 192.168.1.255
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8210b<RXCSUM,TXCSUM,VLAN_MTU,TSO4,WOL_MAGIC,LINKSTATE>
	ether 00:24:8c:3f:92:27
	inet 192.168.1.12 netmask 0xffffff00 broadcast 192.168.1.255
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
	inet 127.0.0.1 netmask 0xff000000
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>


Monitorer ses cartes réseaux

systat -ifstat 1





How To BSD

bsd/bsdnet.txt · Dernière modification : de 127.0.0.1