{"id":701,"date":"2011-01-11T20:37:30","date_gmt":"2011-01-11T19:37:30","guid":{"rendered":"https:\/\/thebc.ch\/blog\/?p=701"},"modified":"2013-02-01T13:00:25","modified_gmt":"2013-02-01T12:00:25","slug":"vmware-esx-hacks","status":"publish","type":"post","link":"https:\/\/thebc.ch\/blog\/?p=701","title":{"rendered":"VMware ESX Hacks"},"content":{"rendered":"<div class='toc toc'>\n<h2>Contents<\/h2>\n<ul class='toc-odd level-1'>\n<\/ul>\n<\/div>\n<div class='toc-end'>&nbsp;<\/div>\n<span id=\"Sniffing_Virtual_Machines\"><h1>Sniffing Virtual Machines<\/h1><\/span>\n<p><a id=\"tcpdump\" name=\"tcpdump\"><\/a><\/p>\n<span id=\"tcpdump\"><h2>tcpdump<\/h2><\/span>\n<p>TCPDUMP ist nicht per default beim ESX Server dabei, aber auf der ESX Server-CD gibt es im Pfad &lt;CDROM&gt;\/RPMS die ganzen Tools.<\/p>\n<p>Einfach tcpdump-xyz.rpm mit<\/p>\n<pre>rpm -ihv tcpdump-xyz.rpm<\/pre>\n<p>installieren.<\/p>\n<p><a id=\"Aktivieren_von_Sniffing\" name=\"Aktivieren_von_Sniffing\"><\/a><\/p>\n<span id=\"Aktivieren_von_Sniffing\"><h2>Aktivieren von Sniffing<\/h2><\/span>\n<pre>For sniffing all traffic on the vmnic0 (you can substitute this for a bond0, etc.)\r\n\r\n# echo \"PromiscuousAllowed yes\" &gt; \/proc\/vmware\/net\/vmnic0\/config\r\n# insmod vmxnet_console devName=\"vmnic0\" nameMask=\"test\"\r\n\r\nThen bring the device up:\r\n# ifconfig test up\r\n\r\nStart the tcpdump\r\n# tcpdump -i test -w &lt;path&amp;filename_of_capture_file&gt;\r\n\r\nTo read the file:\r\n# tcpdump -r &lt;path&amp;filename_of_capture_file&gt;<\/pre>\n<p>Somit sieht man den gesammten Traffic von der VM die am Interface <strong>vmnic0<\/strong> dran h\u00c3\u00a4ngt.<\/p>\n<p><a id=\"Promiscuous_Mode_aktiv_nach_Reboot\" name=\"Promiscuous_Mode_aktiv_nach_Reboot\"><\/a><\/p>\n<span id=\"Promiscuous_Mode_aktiv_nach_Reboot\"><h2>Promiscuous Mode aktiv nach Reboot<\/h2><\/span>\n<p>Bei einem Reboot vom ESX Server bleibt die Einstellung des Promiscuous Modes nicht erhalten.<\/p>\n<p>Das folgende am Ende von <strong>\/etc\/rc.local<\/strong> einf\u00c3\u00bcgen:<\/p>\n<pre>echo \"PromiscuousAllowed yes\" &gt; \/proc\/vmware\/ net\/[vmnic0]\/config\r\ninsmod vmxnet_console devName=\"vmnic0\" nameMask=\"test\"<\/pre>\n<p>Somit bleibt die Einstellung auch nach dem Reboot aktiv.<\/p>\n<p><a id=\"ESX_nur_mit_einer_Netzwerkkarte\" name=\"ESX_nur_mit_einer_Netzwerkkarte\"><\/a><\/p>\n<span id=\"ESX_nur_mit_einer_Netzwerkkarte\"><h1>ESX nur mit einer Netzwerkkarte<\/h1><\/span>\n<p>Das Ziel ist es die Virtual Machines Netzwerk Interfaces auf die &#8220;Service Console&#8221; zu binden, somit kann ein ESX mit nur einer Netzwerkkarte betrieben werden. Sie &#8220;Service Console&#8221; ist sozusagen das Management Interface vom ESX.<\/p>\n<p>Das folgende sind die Schritte um beide Interfaces &#8220;zusammenzuf\u00c3\u00bchren&#8221;:<\/p>\n<p><a id=\".2Fetc.2Fmodules.conf\" name=\".2Fetc.2Fmodules.conf\"><\/a><\/p>\n<span id=\"etcmodules.conf\"><h2>\/etc\/modules.conf<\/h2><\/span>\n<p>Edit <strong>\/etc\/modules.conf<\/strong> und kommentiere folgendes aus:<\/p>\n<pre>alias eth0 e100<\/pre>\n<p>zu<\/p>\n<pre># alias eth0 e100<\/pre>\n<p><a id=\"vmkpcidivy_-i\" name=\"vmkpcidivy_-i\"><\/a><\/p>\n<span id=\"vmkpcidivy_-i\"><h2>vmkpcidivy -i<\/h2><\/span>\n<p>Mit dem Tool <strong>vmxpcidviy -i<\/strong> kann nun das Physische Interface den VM zugeordnet werden:<\/p>\n<pre>[root@SRVESX07-LAB root]# vmkpcidivy -i\r\n\r\nChecking for existing VMnix Boot Configurations.\r\n\r\nThe following VMnix kernel images are defined on your system:\r\n\r\nBoot image configuration: esx\r\n  Image file: \/boot\/vmlinuz-2.4.9-vmnix2\r\n  Memory: 192M\r\n  Service Console devices:\r\n    SCSI storage controller: Symbios Logic Inc. (formerly NCR) LSI Logic Fusion MPT 53C1030 (rev 07) (shared)\r\n  VM devices:\r\n    Ethernet controller: BROADCOM Corporation NetXtreme BCM5721 Gigabit Ethernet (rev 11)\r\n    SCSI storage controller: Symbios Logic Inc. (formerly NCR) LSI Logic Fusion MPT 53C1030 (rev 07) (shared)\r\n\r\nType in the name of the boot image configuration you wish to configure\r\nor type \"new\" to create a new image [esx]: \r\n\r\nSelected configuration was 'esx'.\r\n\r\nConfiguring your setup.  Enter in the options that you want.  Defaults have\r\nbeen provided.\r\n\r\nName of this configuration [esx]: \r\n\r\nNow allocating memory to the Service Console.  The memory that is not allocated\r\nto the Service Console will be allocated to the VMs.  Be sure to indicate a\r\nnumber smaller than you actually have on your system or you may not be able to\r\nrun any VMs.\r\n\r\nYour system is reporting approximately 2,559 MB of memory.\r\nNote: you cannot allocate more than 800 MB to the Service Console.\r\n\r\nIf you plan to run 4 virtual machines or fewer, 128 MB should suffice.\r\nSet this to 192 MB for 8 virtual machines, 272 MB for 16 virtual\r\nmachines, 384 MB for 32 virtual machines, or 512 MB for more than\r\n32 virtual machines.\r\n\r\nAmount of memory (in megs) to allocate to the Service Console [192]:\r\nEnable hyperthreading? (Only works with 8 or less physical processors) [y]: \r\n\r\nNow to divide the SCSI controllers and network adapters.  In this process,\r\nyou will select whether to give the previous devices to the Service Console or\r\nthe virtual machines that you will be running.  In order to ensure optimal\r\nperformance for your virtual machines, we suggest you allocate as many devices\r\nas possible to the virtual machines, leaving only the ones necessary to\r\nconfigure and maintain the Service Console.\r\n\r\nType 'c' to allocate to the Service Console or 'v' to allocate to the virtual\r\nmachines, or 's' to share between both.\r\n\r\nEthernet controller BROADCOM Corporation NetXtreme BCM5721 Gigabit Ethernet (rev 11) running on bus 5 device 0 function 0 (bcm5700.o) [vmnic0]  [c]: v\r\n.\r\n.\r\n.<\/pre>\n<p>Wichtig ist das der Kontroller auf &#8220;v&#8221; (virtual machines) gestellt ist.<\/p>\n<p><a id=\".2Fetc.2Frc.local\" name=\".2Fetc.2Frc.local\"><\/a><\/p>\n<span id=\"etcrc.local\"><h2>\/etc\/rc.local<\/h2><\/span>\n<p>Wen der ESX rebootet ist kein Netzwerk Adapter assigned zur Service Console, folgendermassen kann diesm nun beim booten aktiviert werden:<\/p>\n<p>Eintrag am Ende im <strong>\/etc\/rc.local<\/strong><\/p>\n<pre>insmod vmxnet_console devName=\"vmnic0\"\r\nifup eth0<\/pre>\n<p><a id=\"VM_Config\" name=\"VM_Config\"><\/a><\/p>\n<span id=\"VM_Config\"><h2>VM Config<\/h2><\/span>\n<p>Nun kann f\u00c3\u00bcr die Virtual Machines im Mgmt-Webinterface das physische Interface den VM zugewiesen werden!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sniffing Virtual Machines tcpdump TCPDUMP ist nicht per default beim ESX Server dabei, aber auf der ESX Server-CD gibt es im Pfad &lt;CDROM&gt;\/RPMS die ganzen Tools. Einfach tcpdump-xyz.rpm mit rpm -ihv tcpdump-xyz.rpm installieren. Aktivieren von Sniffing For sniffing all traffic &hellip; <a href=\"https:\/\/thebc.ch\/blog\/?p=701\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,17],"tags":[],"class_list":["post-701","post","type-post","status-publish","format-standard","hentry","category-software","category-vmware"],"_links":{"self":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=701"}],"version-history":[{"count":6,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/701\/revisions"}],"predecessor-version":[{"id":2680,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/701\/revisions\/2680"}],"wp:attachment":[{"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thebc.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}