IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Virtualisation Discussion :

XCP-NG + FreeBSD NAT -> Comportement étrange


Sujet :

Virtualisation

  1. #1
    Expert confirmé
    Avatar de becket
    Profil pro
    Informaticien multitâches
    Inscrit en
    Février 2005
    Messages
    2 854
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations professionnelles :
    Activité : Informaticien multitâches
    Secteur : Service public

    Informations forums :
    Inscription : Février 2005
    Messages : 2 854
    Points : 5 915
    Points
    5 915
    Par défaut XCP-NG + FreeBSD NAT -> Comportement étrange
    Bonjour à tous,

    Je fait appel à vous car je suis face à un comportement étrange du couple FreeBSD + XCP-NG

    Je vous explique la situation, j'ai deux machines dans XCP-NG

    1 - FreeBSD ( Le "routeur" ) qui possède deux cartes

    • Carte1 - Carte liée à la carte physique connecté à mon LAN
    • Carte2 : Carte Internal ( sans liaison à une carte physique ) : DMZ


    2 - Debian ( le "client" ) qui possède une carte
    • Carte1 : Carte Internal ( sans liaison à une carte physique ) : DMZ




    La configuration "simpliste" du routeur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    root@FreeBSD:~ # cat /etc/rc.conf | grep -E '(pf_|gateway_)'
    pf_enable="YES"
    gateway_enable="YES"
    root@FreeBSD:~ # pfctl -sr
    scrub on lo0 all fragment reassemble
    pass in all flags S/SA keep state
    root@FreeBSD:~ # pfctl -sn
    nat on xn0 inet from 10.10.10.0/24 to any -> (xn0) round-robin
    root@FreeBSD:~ # pfctl -sR
    Enabled
    root@FreeBSD:~ # ifconfig xn1
    xn1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
            options=503<RXCSUM,TXCSUM,TSO4,LRO>
            ether 26:69:c8:7c:5a:68
            inet 10.10.10.1 netmask 0xffffff00 broadcast 10.10.10.255
            media: Ethernet manual
            status: active
            nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    Du coté du client, tant que je fait de l'icmp, cela fonctionne

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    bashhar@GLPI:~$ netstat -arn4
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
    0.0.0.0         10.10.10.1      0.0.0.0         UG        0 0          0 eth0
    10.10.10.0      0.0.0.0         255.255.255.0   U         0 0          0 eth0
    bashhar@GLPI:~$ ping -c 1 10.10.10.254
    PING 10.10.10.254 (10.10.10.254) 56(84) bytes of data.
    64 bytes from 10.10.10.254: icmp_seq=1 ttl=64 time=0.045 ms
    
    --- 10.10.10.254 ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.045/0.045/0.045/0.000 ms
    bashhar@GLPI:~$ ping -c 1 10.10.10.1
    PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
    64 bytes from 10.10.10.1: icmp_seq=1 ttl=64 time=0.649 ms
    
    --- 10.10.10.1 ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.649/0.649/0.649/0.000 ms
    bashhar@GLPI:~$ ping -c 1 1.1.1.1
    PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
    64 bytes from 1.1.1.1: icmp_seq=1 ttl=55 time=26.6 ms
    
    --- 1.1.1.1 ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 26.616/26.616/26.616/0.000 ms

    Par contre, en tcp ou en udp ...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    bashhar@GLPI:~$ ping perdu.com
    ping: perdu.com: Temporary failure in name resolution
    
    bashhar@GLPI:~$ ssh 192.168.142.1 -p 2222
    
    ssh: connect to host 192.168.142.1 port 2222: Connection timed out

    J'ai testé cette configuration en dehors de XCP-NG ( -> VirtualBOX ) et cela fonctionne. Auriez-vous une explication à ce comportement ? Et un moyen de résoudre le problème

  2. #2
    Expert confirmé
    Avatar de becket
    Profil pro
    Informaticien multitâches
    Inscrit en
    Février 2005
    Messages
    2 854
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations professionnelles :
    Activité : Informaticien multitâches
    Secteur : Service public

    Informations forums :
    Inscription : Février 2005
    Messages : 2 854
    Points : 5 915
    Points
    5 915
    Par défaut
    Solution trouvée :

    https://xcp-ng.org/docs/guides.html#pfsense-opnsense-vm

    Now is the most important step: we must disable tx checksum offload on the virtual xen interfaces of the VM. This is because network traffic between VMs in a hypervisor is not populated with a typical ethernet checksum, since they only traverse server memory and never leave over a physical cable. The majority of operating systems know to expect this when virtualized and handle ethernet frames with empty checksums without issue. However pf in FreeBSD does not handle them correctly and will drop them, leading to broken performance.
    Donc, il faut :

    1 - Installer les guest utilities
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    pkg install xe-guest-utilities
    echo 'xenguest_enable="YES"' >> /etc/rc.conf.local
    ln -s /usr/local/etc/rc.d/xenguest /usr/local/etc/rc.d/xenguest.sh
    service xenguest start

    2 - Desactiver le tx-load

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    #Pour trouver l'uuid de la VM 
    xe vm-list
    #Pour trouver uuid des cartes réseaux 
    xe vif-list vm-uuid=08fcfc01-VM-UUID-21b5-2262-741da6f5bfb0
    # Pour desactiver le tx-load sur la cart 
    xe vif-param-set uuid=789358b4-CARTEUUID-bfb3-0b7721e4661b other-config:ethtool-tx="off"

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Forms6i] Un IF-ELSIF au comportement étrange
    Par lafouine dans le forum Forms
    Réponses: 11
    Dernier message: 13/09/2005, 15h40
  2. Comportement étrange apres une désinstallation
    Par Sunchaser dans le forum Excel
    Réponses: 4
    Dernier message: 06/08/2005, 19h44
  3. comportement étrange d'une jointure ...
    Par amenis dans le forum PostgreSQL
    Réponses: 5
    Dernier message: 10/02/2005, 21h27
  4. [Système][Runtime][Exec] Comportement étrange au lancement de BeSweet
    Par divxdede dans le forum API standards et tierces
    Réponses: 1
    Dernier message: 06/06/2004, 09h54
  5. Réponses: 2
    Dernier message: 22/09/2003, 11h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo