{"id":128,"date":"2021-01-21T23:54:19","date_gmt":"2021-01-21T21:54:19","guid":{"rendered":"http:\/\/my-virt.alfadir.net\/?p=128"},"modified":"2024-12-12T17:53:04","modified_gmt":"2024-12-12T15:53:04","slug":"adding-static-route-to-ws1-access","status":"publish","type":"post","link":"https:\/\/my-virt.alfadir.net\/index.php\/2021\/01\/21\/adding-static-route-to-ws1-access\/","title":{"rendered":"Adding Static Route to WS1 Access"},"content":{"rendered":"\n<p>I had a request from Spanish colleagues about adding static routes to Workspace One Access (in their case it was because of database in a different network).<\/p>\n\n\n\n<p>I first had a look on our internal channel on Slack and find a first way to do it &#8230; but with Identity Manager version 3.3. However, when I try to test it in my Home Lab using my on-premise WS1 Access 20.10 it was totally different. vIDM 3.3 is based on Suse Linux when WS1 Access 20.10 is based on Photon 3. After some exchange by mail with my colleagues, they sent me the procedure they used for their deployment&#8230; different for the first two !!!<br>Yes they deployed Workspace One Access 20.01&#8230;<\/p>\n\n\n\n<p>Basically both method work with vIDM 3.3 and Workspace One v20.01 as both are running Suse Linux<\/p>\n\n\n\n<p>Method<strong> 1 :  for Identity Manager 3.3  and WS1 Access 20.01<\/strong>: <em>(thanks to Mahmood Ramzan for this one) <\/em><\/p>\n\n\n\n<p>First edit &#8220;routes&#8221; files in \/etc\/sysconfig\/network<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/sysconfig\/network\/routes<\/code><\/pre>\n\n\n\n<p>Then add your route in this form :  &lt;net_range&gt;\/&lt;mask&gt; &lt;gateway&gt; &lt;interface&gt;<\/p>\n\n\n\n<pre id=\"block-3d8ca53c-5b24-43dc-a205-98b0bb0c14b5\" class=\"wp-block-code\"><code>10.1.2.0\/24 192.168.12.254 eth0<\/code><\/pre>\n\n\n\n<p>Then restart your network and confirm the route is persistent:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \/etc\/init.d\/network restart\n# ip route list<\/code><\/pre>\n\n\n\n<p>Method<strong><strong> 2 : for Identity Manager 3.3 and WS1 Access 20.01<\/strong>:<\/strong> <em>(thanks to Javier Perez for this one) :<\/em><\/p>\n\n\n\n<p>After connecting to WS1 using sshuser and sudo as root (or direct login as root), create the ifroute-eth0 file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vim \/etc\/sysconfig\/network\/ifroute-eth0\t<\/code><\/pre>\n\n\n\n<p>Add your route (same format as for vIDM 3.3)<br>and set permission on this file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># chmod 644 \/etc\/sysconfig\/network\/ifroute-eth0<\/code><\/pre>\n\n\n\n<p>Restart your network as explained above.<\/p>\n\n\n\n<p><strong>Method for Workspace One Access 20.10 and upward :<\/strong><br>Starting with Workspace One Access 20.10, appliance are based on Photon 3.0. So adding a file call <em>route-eth0<\/em> in <em>\/etc\/sysconfig\/network-scripts<\/em> make it works by running \/etc\/sysconfig\/network-scripts\/ifup-routes but it doesn&#8217;t works when booting the appliance.<\/p>\n\n\n\n<p>To add static routes to Photon appliance you need to follow this procedure :<\/p>\n\n\n\n<p>So once logged as root edit this file : \/usr\/local\/horizon\/scripts\/networkwizard.hzn<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vi \/usr\/local\/horizon\/scripts\/networkwizard.hzn<\/code><\/pre>\n\n\n\n<p>Find the section &#8220;function save_sysconfig_properties&#8221; around line 800 (803 to be precise)<\/p>\n\n\n\n<p>Alter the file to set the routes by adding the following lines in green :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function save_sysconfig_properties() {\n    if &#91; $ETHO_DEVICE_RESTORED -eq 0 ]; then\n      # any DHCP\n      local DHCP=no\n      if &#91; \"$SYSCONF_IPV4_IP0\" = \"DHCP\" -a \"${SYSCONF_IPV6_IP&#91;0]}\" = \"DHCP\" ]; then\n          DHCP=\"yes\"\n      elif &#91; \"$SYSCONF_IPV4_IP0\" = \"DHCP\" ]; then\n          DHCP=\"ipv4\"\n      elif &#91; \"${SYSCONF_IPV6_IP&#91;0]}\" = \"DHCP\" ]; then\n          DHCP=\"ipv6\"\n      fi\n      echo save $ETH0_CONF\n      echo -n &gt; $ETH0_CONF\n      echo \"&#91;Match]\" &gt;&gt; $ETH0_CONF\n      echo \"Name=eth0\" &gt;&gt; $ETH0_CONF\n      echo \"\" &gt;&gt; $ETH0_CONF\n      echo \"&#91;Network]\" &gt;&gt; $ETH0_CONF\n      echo \"DHCP=$DHCP\" &gt;&gt; $ETH0_CONF\n      if &#91; -n \"$SYSCONF_IPV4_IP0\" -a \"$SYSCONF_IPV4_IP0\" != \"DHCP\" ]; then\n          echo \"Address=$SYSCONF_IPV4_IP0\/`mask2cdr $SYSCONF_IPV4_NETMASK`\" &gt;&gt; $ETH0_CONF\n          echo \"Gateway=$SYSCONF_IPV4_GATEWAY\" &gt;&gt; $ETH0_CONF\n          echo \"DNS=$SYSCONF_NET_DNS\" &gt;&gt; $ETH0_CONF\n          echo \"LinkLocalAddressing=no\" &gt;&gt; $ETH0_CONF\n          echo \"IPv6AcceptRA=no\" &gt;&gt; $ETH0_CONF\n<strong><span class=\"has-inline-color has-vivid-green-cyan-color\">          echo \"&#91;Route]\" &gt;&gt; $ETH0_CONF\n          echo \"Destination=10.0.0.0\/24\" &gt;&gt; $ETH0_CONF\n          echo \"Gateway=192.168.0.250\" &gt;&gt; $ETH0_CONF\n          echo \"GatewayOnlink=true\" &gt;&gt; $ETH0_CONF<\/span><\/strong>\n      fi\n      if &#91; -n \"${SYSCONF_IPV6_IP&#91;0]}\" -a \"${SYSCONF_IPV6_IP&#91;0]}\" != \"DHCP\" ]; then\n          local ndx=0\n          while true\n          do\n              local tmpip=${SYSCONF_IPV6_IP&#91;$ndx]}\n              local tmppfx=${SYSCONF_IPV6_PFX&#91;$ndx]}\n              if &#91; -z \"$tmpip\" ]; then\n                  break\n              fi\n              echo \"Address$ndx='$tmpip\/$tmppfx'\" &gt;&gt; $ETH0_CONF\n              ndx=$(($ndx + 1))\n          done\n      fi\n    fi\n}\n<\/code><\/pre>\n\n\n\n<p>Reboot the appliance to ensure it works fine<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a request from Spanish colleagues about adding static routes to Workspace One Access (in their case it was because of database in a different&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[14,13,11,12],"class_list":["post-128","post","type-post","status-publish","format-standard","hentry","category-identity-manager","tag-horizon","tag-static-route","tag-vmware","tag-workspace-one"],"_links":{"self":[{"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/posts\/128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/comments?post=128"}],"version-history":[{"count":5,"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/posts\/128\/revisions"}],"predecessor-version":[{"id":377,"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/posts\/128\/revisions\/377"}],"wp:attachment":[{"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/media?parent=128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/categories?post=128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/my-virt.alfadir.net\/index.php\/wp-json\/wp\/v2\/tags?post=128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}