{"id":133,"date":"2019-05-02T10:56:13","date_gmt":"2019-05-02T08:56:13","guid":{"rendered":"http:\/\/www.underealm.com\/tech\/?p=133"},"modified":"2019-05-02T10:56:51","modified_gmt":"2019-05-02T08:56:51","slug":"auto-ip-assignment-to-a-dom0-virtual-interface-part-2","status":"publish","type":"post","link":"http:\/\/www.underealm.com\/tech\/2019\/05\/auto-ip-assignment-to-a-dom0-virtual-interface-part-2\/","title":{"rendered":"Auto IP assignment to a dom0 virtual interface \u2013 Part #2"},"content":{"rendered":"<p>As we saw <a href=\"\/tech\/2019\/04\/auto-ip-assignment-to-a-dom0-virtual-interface\/\">eariler<\/a>, with careful configuration and the use of my small service, we&#8217;re able to remote in the dom0 no problem, but the main pitfall I didn&#8217;t realize was there until a couple days ago, is that in <a href=\"https:\/\/github.com\/SkyDubh\/vif-ip-binder\/tree\/0695e36ed6a14fd38a3925bd33915cb7b2ad9373\">that iteration of the service<\/a>, <a href=\"https:\/\/github.com\/SkyDubh\/vif-ip-binder\">now updated<\/a>, we lost console and performance monitor for most of the VMs spawning after the UTM. I tried <a href=\"https:\/\/xcp-ng.org\/forum\/topic\/1268\/console-performance-not-working\">asking for pointers<\/a>, but given the \u201cexperimental\u201d nature of my setup, I was left on my own.<\/p>\n<h2>The problem<\/h2>\n<p>First of all, while I was setting things up I left an ip outside of the class I was using to the management interface, in order for it not to interfere. This resulted in consoles not working for about any VM, since instead of a specified class it was using 192.168.4.0:<\/p>\n<pre class=\"terminal\"># xe console-list\nuuid ( RO)             : &lt;uuid&gt;\n         protocol ( RO): RFB\n         location ( RO): https:\/\/192.168.4.x\/console?ref=OpaqueRef:&lt;ref&gt;<\/pre>\n<p>Reconfiguration through `xsconsole` or Center don&#8217;t work, obviously, so the only thing left to do was to restart in safe mode and change to the proper subnet. So far so good.<\/p>\n<p>Upon restart everything seems working, up to the time I actually start a different VM:<\/p>\n<pre class=\"terminal\"># xe console-list\nuuid ( RO)             : &lt;uuid&gt;\n         protocol ( RO): RFB\n         location ( RO): https:\/\/\/console?ref=OpaqueRef:&lt;ref&gt;<\/pre>\n<p>This time everything was configured properly, but it still wouldn&#8217;t work. As it turns out, somewhere between starting the VMs and setting up the network, the bridge loses its ip. Xapi doesn&#8217;t care in the slightest what IP you&#8217;re connecting to, so when it has to pass a link to a management section, it just looks up its management network bridge for the address binded to it and generates it.<\/p>\n<h2>The solution<\/h2>\n<p>The solution is pretty simple: on top of adding a \/24 mask to the VIF you&#8217;re connecting to, you also need to add the same ip with a \/32 mask to the management bridge:<\/p>\n<pre class=\"terminal\"># ifconfig\nxapi1: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500\n        inet 192.168.0.1  netmask 255.255.255.0  broadcast 0.0.0.0\n\nxenbr0: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1500\n        inet 192.168.0.1  netmask 255.255.255.255  broadcast 0.0.0.0<\/pre>\n<p>Thanks to [SkiD] for moral support and reminding me that this configuration is actually valid, since in routing terms `xenbr0` doesn&#8217;t go anywhere.<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we saw eariler, with careful configuration and the use of my small service, we&#8217;re able to remote in the dom0 no problem, but the main pitfall I didn&#8217;t realize was there until a couple days ago, is that in that iteration of the service, now updated, we lost console and performance monitor for most [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[67,68,65,64],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-xcp-ng","tag-hypervisor","tag-network","tag-xcp-ng","tag-xen"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts\/133"}],"collection":[{"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":2,"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":135,"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/posts\/133\/revisions\/135"}],"wp:attachment":[{"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.underealm.com\/tech\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}