Outils pour utilisateurs

Outils du site


informatique_vlan

VLAN

Liens

Creer VLAN

Sur interface eth1

# ifconfig eth1 0.0.0.0 up
# vconfig add eth1 <NUMERO_VLAN_1>
# vconfig add eth1 <NUMERO_VLAN_2>

Suivre les communications:

# tshark -i eth1 vlan

ou

# tcpdump -i eth1
# tcpdump -i eth1 vlan <NUMERO_VLAN>

Mettre une IP

# ifconfig eth1.NUMERO_VLAN 192.168.1.2 netmask 255.255.255.0

corriger ARP

Sur un autre poste, on peut constater que plusieurs interfaces repondent aux requetes ARP… pas bien pour nos tests:

# arping 192.168.1.2
ARPING 192.168.1.2
60 bytes from 00:50:xx:xx:a8:31 (192.168.1.2): index=0 time=475.883 usec
60 bytes from 00:01:yy:yy:d5:98 (192.168.1.2): index=1 time=588.894 usec
60 bytes from 00:50:xx:xx:a8:31 (192.168.1.2): index=2 time=307.083 usec
60 bytes from 00:01:yy:yy:d5:98 (192.168.1.2): index=3 time=344.038 usec

Sur la machine 'vlan' :

# echo "1" > /proc/sys/net/ipv4/conf/all/arp_ignore

Ou dans: /etc/sysctl.conf

...
net.ipv4.conf.all.arp_ignore = 1
:!: ca serait pas plutot: net.ipv4.conf.default.arp_ignore=1

Et puis, pour appliquer les changements immediatements:

# sysctl -p

Classe d'IP

Dans /etc/network/interface :

#auto eth1
iface eth1 inet static
      address 10.18.5.66
      netmask 255.255.255.192

Et puis:

route add -net 10.18.5.0 netmask 255.255.255.0 gw 10.18.5.65

Tips

tcpdump

Afficher le VLAN sur un port en 8021q:

# tcpdump -e -n -i <Interface>
...
..., ethertype 802.1Q (0x8100), length 68: vlan 123,...
...
informatique_vlan.txt · Dernière modification : 2011/09/30 21:39 de thierry