{"id":1139,"date":"2017-09-08T20:10:38","date_gmt":"2017-09-08T20:10:38","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2017\/09\/08\/vsrx-on-an-isolated-network-how-do-i-provision-via-cloud-init\/"},"modified":"2023-01-06T16:56:19","modified_gmt":"2023-01-06T16:56:19","slug":"vsrx-on-an-isolated-network-how-do-i-provision-via-cloud-init","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Cloud\/Openstack\/vsrx-on-an-isolated-network-how-do-i-provision-via-cloud-init.html","title":{"rendered":"vSRX on an Isolated Network: Provision via Cloud-Init"},"content":{"rendered":"
Introduced within the Junos OS Release – 15.1X49-D100 – the vSRX now comes with cloud-init. As per Junipers configuration guide,<\/p>\n
… the cloud-init package (version 0.7x) comes pre-installed in the vSRX image to help simplify configuring new vSRX instances operating in an OpenStack environment according to a specified user-data file. Cloud-init is performed during the first-time boot of a vSRX instance.[1]<\/a><\/sup><\/p>\n In other words, you can pass the Junos configuration to the instance at point of creation, via the use of the user-data key. Like so:<\/p>\n In the background this uploads the configuration to the Nova metadata service, which can then be retrieved via . The intention is that the vSRX then calls this URL during the initial boot and pulling the required config. Now, to get to this address traffic from your host must either go through the router namespace or the DHCP namespace. For the topic of this discussion will look into the DHCP namespace method.<\/p>\n Within the DHCP namespace (upon the Network Controller) there is a Neutron metadata proxy that forwards the request onto a Neutron metadata agent, who then forwards onto the Nova metadata API. As the Neutron metadata proxy is hosted upon the DHCP agent IP upon the given subnet, it allows the instance to query the metadata service via a local IP, i.e:<\/p>\n However, this leads to one small detail. When the vSRX boots up it must have a route telling it that it to reach 169.254.169.254<\/span> via the DHCP agents IP. Neutron provides the option to inject static routes into the instance at boot via DHCP and the 121 option. But here lies the problem – the vSRX does not support option 121.<\/p>\n The solution to the issue is this, we set the default gateway on the Neutron subnet (that we attach for management\/FXP0) to that of the DHCP agent IP. Lets step through how this works,<\/p>\n [1]<\/a>\u00a0http:\/\/www.juniper.net\/documentation\/en_US\/vsrx\/topics\/task\/configuration\/security-vsrx-cloud-init-support.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":" Background Introduced within the Junos OS Release – 15.1X49-D100 – the vSRX now comes with cloud-init. As per Junipers configuration guide, … the cloud-init package (version 0.7x) comes pre-installed in the vSRX image to help simplify configuring new vSRX instances operating in an OpenStack environment according to a specified user-data file. Cloud-init is performed during … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":1138,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[],"yoast_head":"\nopenstack server create --image vsrx-image-15.1X49-D100.6 \\\r\n --flavor vsrx_flavor \\\r\n --user-data \/root\/juniper.conf.txt \\\r\n --nic net-id=587b75b5-ceb6-49e8-b850-861809f14d5e,v4-fixed-ip=172.29.100.105 \\\r\n --nic net-id=423b2b1b-5591-4861-baab-64e9fef84f47,v4-fixed-ip=192.168.1.5 \\\r\n --nic net-id=24ca3340-a3de-4708-ad2b-2a2ab826250c,v4-fixed-ip=172.29.50.105 \\\r\n vsrx-15.1X49-D100.6<\/pre>\n
root@% ifconfig fxp0\r\nfxp0: encaps: ether; framing: ether\r\n flags=0x3\/0x8000 <PRESENT|RUNNING>\r\n curr media: i802 fa:16:3e:e7:b5:2f\r\nfxp0.0: flags=0x4008000 <UP|MULTICAST>\r\n inet primary mtu 1500 local=172.29.100.106 dest=172.29.100.0\/24 bcast=172.29.100.255\r\n\r\n\r\nroot@% curl \r\n#junos-config\r\n## Last changed: 2017-09-04 16:07:32 UTC\r\nsystem {\r\n services {\r\n ssh;\r\n web-management {\r\n http {\r\n interface fxp0.0;\r\n }\r\n }\r\n }<\/pre>\n
Solution<\/h2>\n
\n
References<\/h2>\n