{"id":54367,"date":"2019-12-24T00:00:00","date_gmt":"2019-12-23T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/junos-pyez-na-primere-zadachi-po-poisku-svobodnyh-podsetej-ipv4"},"modified":"2020-02-18T14:02:22","modified_gmt":"2020-02-18T11:02:22","slug":"junos-pyez-na-primere-zadachi-po-poisku-svobodnyh-podsetej-ipv4","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/junos-pyez-na-primere-zadachi-po-poisku-svobodnyh-podsetej-ipv4","title":{"rendered":"Junos PyEZ n\u00eb shembullin e nj\u00eb detyre p\u00ebr t\u00eb gjetur n\u00ebnrrjetet e lira ipv4","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Junos PyEZ \u2014 \u201cPython microframework that enables you to manage and automate devices running Junos OS\u201d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u043a\u0430\u043a \u043c\u044b \u043b\u044e\u0431\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0439 \u2014 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Python \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS. \u0412\u044b\u0431\u043e\u0440 \u0438\u043c\u0435\u043d\u043d\u043e\u0439 \u044d\u0442\u043e\u0439 \u0441\u0432\u044f\u0437\u043a\u0438 Python + Junos PyEZ \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0438\u0437-\u0437\u0430 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u043f\u043e\u0440\u043e\u0433\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Python \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Junos PyEZ, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043d\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 Junos OS.<\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430<\/h4>\n<p>\n\u0410\u0443\u0434\u0438\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 ipv4 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430 \u2014 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e \u043d\u0435\u0439 \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u0445 \u043d\u0430 \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u043c \u0440\u043e\u043b\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS.<\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>\nPython + Junos PyEZ, \u0445\u043e\u0442\u044f \u0431\u044b\u043b \u0441\u043e\u0431\u043b\u0430\u0437\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 paramiko \u0438 ssh.exec_command,<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex> \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 netconf. Netconf \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 (remote procedure call RPC) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 XML, \u0432 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Junos PyEZ \u0438\u0437 PyPI, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">$ pip install junos-eznc<\/code><\/pre>\n<p>\n\u041c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0432\u0435\u0442\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430 GitHub \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">$ pip install git+https:\/\/github.com\/Juniper\/py-junos-eznc.git<\/code><\/pre>\n<p>\n\u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0447\u0435\u0440\u0435\u0437<\/p>\n<pre><code class=\"bash\">$ pip install -r requirements.txt <\/code><\/pre>\n<p>\n\u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b. \u0412 \u043c\u043e\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 <b>requirements.txt<\/b> \u0438\u0445 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0435, \u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<pre><code class=\"plaintext\">junos-eznc\nnetaddr<\/code><\/pre>\n<p>\n\u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0435\u0440\u0435\u0442 \u0438\u043c\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u0438\u043c\u0435\u043d\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u044e\u0447 show_route.py -u &lt;user_name&gt; getpass.getpass \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0438\u0437 stdin \u0442\u0430\u043a \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0435\u0433\u043e hostname \u0438\u043b\u0438 ip-\u0430\u0434\u0440\u0435\u0441. \u0412\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b.<\/p>\n<p>Junos PyEZ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c, telnet \u0438\u043b\u0438 netconf \u0447\u0435\u0440\u0435\u0437 ssh. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 Device \u043c\u043e\u0434\u0443\u043b\u044f jnpr.junos<\/p>\n<pre><code class=\"python\">with jnpr.junos.Device(host=router,\n                           user=args.name,\n                           passwd=password) as dev:<\/code><\/pre>\n<p>\n\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043e \u0432\u0441\u0435\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0440\u043e\u0443\u0442\u0435\u0440\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u0445 \u0447\u0435\u0440\u0435\u0437 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0438\u043b\u0438 \u0432\u044b\u0437\u043e\u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440, \u043a\u043e\u043c\u0443 \u043a\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0439. <\/p>\n<pre><code class=\"python\">data = dev.rpc.get_route_information()<\/code><\/pre>\n<p>\n\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 Junos OS <\/p>\n<pre><code class=\"bash\">user@router&gt; show route | display xml<\/code><\/pre>\n<p>\n\u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043a\u043e\u043c\u0430\u043d\u0434\u044b rpc, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0435\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 RPC, \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0438\u043c\u0435\u043d\u0430. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0435\u0433\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043c\u0435\u0442\u043e\u0434\u0430, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u043a\u0438 \u0434\u0435\u0444\u0438\u0441\u0430 \u043d\u0430 \u043d\u0438\u0436\u043d\u0438\u0435 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435.<\/p>\n<pre><code class=\"bash\">user@router&gt; show route | display xml rpc\n&lt;rpc-reply >route_list = data.xpath(&quot;\/\/rt-destination\/text()&quot;)<\/code><\/pre>\n<p>\n\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043e\u0431\u0435\u0440\u043d\u0443\u043b \u0432 \u0446\u0438\u043a\u043b while, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0438\u0437 \u0442\u0435\u0445, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u043e\u0443\u0442\u0435\u0440 \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442. \u0421\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0440\u043e\u0443\u0442\u0435\u0440 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e \u0437\u043d\u0430\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 OSPF, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u043b\u0443\u0447\u0448\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/p>\n<pre><code class=\"python\">data = dev.rpc.get_ospf_route_information()<\/code><\/pre>\n<p><\/p>\n<h4>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u0446\u0438\u043a\u043b\u0430 while<\/h4>\n<p>\n\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u0441 \u043c\u0430\u0441\u043a\u043e\u0439 \u0438 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u0440\u0435\u0445 \u043e\u043a\u0442\u0435\u0442\u043e\u0432 \u0438\u0437 \u0441\u0435\u0442\u0438 \u044d\u0442\u043e\u0439 \u0436\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0438, \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u043f\u043e\u0438\u0441\u043a\u0430. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043f\u043e\u043a\u0430 \u043b\u0443\u0447\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b. \u0414\u0430\u043b\u0435\u0435 \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 route_list \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u0440\u0435\u0445 \u043e\u043a\u0442\u0435\u0442\u043e\u0432 \u0432\u044b\u0431\u0438\u0440\u0430\u044e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u043d\u044f \u043f\u043e\u0434\u0441\u0435\u0442\u0438 <\/p>\n<pre><code class=\"python\">tmp = re.search(r'^%sS*' % subnet_search, route_list[i])<\/code><\/pre>\n<p>\n\u0427\u0435\u0440\u0435\u0437 IPNetwork, \u043c\u043e\u0434\u0443\u043b\u044f netaddr, \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 ipv4 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 <\/p>\n<pre><code class=\"python\">range_subnet = netaddr.IPNetwork(tmp.group(0))<\/code><\/pre>\n<p>\n\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f IPNetwork \u0438\u0437 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0441\u0435\u0442\u0438 \u0441 \u043c\u0430\u0441\u043a\u043e\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0437\u0430\u043d\u044f\u0442\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432. <\/p>\n<pre><code class=\"python\">for i in set(net_list).difference(set(busyip)):\n        freeip.append(i)<\/code><\/pre>\n<p>\n\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0432\u044b\u0432\u043e\u0436\u0443 \u0432 \u0432\u0438\u0434\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 <\/p>\n<pre><code class=\"python\">print(netaddr.IPSet(freeip))<\/code><\/pre>\n<p>\n\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u043c\u0443\u0442\u0430\u0442\u043e\u0440\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u0440\u043e\u043b\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043c\u043e\u0434\u0435\u043b\u0438 ex4550, ex4600<\/p>\n<pre><code class=\"python\">\n#!\/usr\/bin\/env python3\n# -*- coding: utf-8 -*-\nimport argparse\nimport getpass\nimport netaddr\nimport re\nimport sys\n\nimport jnpr.junos\n\nparser = argparse.ArgumentParser()\nparser.add_argument('-u', '--user',\n                    action='store',\n                    dest='name',\n                    help='Enter login from tacacs if it differs from the '\n                         'username in the system.')\nargs = parser.parse_args()\n\nif not args.name:\n    args.name = getpass.getuser()    # Return the \u201clogin name\u201d of the user.\nrouter = input(&quot;Full routers name: &quot;)\npassword = getpass.getpass(&quot;Password: &quot;)\n\ntry:\n    # Authenticates to a device running Junos, for get information about routs\n    # into xml format and selects by tag.\n    route_list = []\n    with jnpr.junos.Device(host=router,\n                           user=args.name,\n                           passwd=password) as dev:\n        data = dev.rpc.get_route_information()\n    route_list = data.xpath(&quot;\/\/rt-destination\/text()&quot;)\nexcept (jnpr.junos.exception.ConnectRefusedError,\n        jnpr.junos.exception.ConnectUnknownHostError) as err:\n    print(&quot;Equipment name or password wrong.&quot;)\n    sys.exit(1)\n\nwhile True:\n    subnet = input(&quot;Net with mask: &quot;)\n    subnet_search = input(&quot;Input no more three octet: &quot;)\n    # Gets a list of busy IP addresses from the received subnets.\n    busyip = []\n    for i in range(len(route_list)):\n        tmp = re.search(r'^%sS*' % subnet_search, route_list[i])\n        if tmp:\n            range_subnet = netaddr.IPNetwork(tmp.group(0))\n            for ip in range_subnet:\n                busyip.append(&quot;%s&quot; % ip)\n    range_subnet = netaddr.IPNetwork(subnet)\n    # Gets list ip adresses from subnetworks lists.\n    net_list = []\n    for ip in range_subnet:\n        net_list.append(&quot;%s&quot; % ip)\n    # \u0421omparing lists.\n    freeip = []\n    for i in set(net_list).difference(set(busyip)):\n        freeip.append(i)\n    print(netaddr.IPSet(freeip))\n\n    request = input(&quot;To run request again enter yes or y, &quot;\n                    &quot;press 'enter', complete request: &quot;)\n    if request in (&quot;yes&quot;, &quot;y&quot;):\n        continue\n    else:\n        print('Bye')\n        break\n<\/code><\/pre>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/481648\/\">habr.com<\/a><\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Junos PyEZ \u2014 \u201cPython microframework that enables you to manage and automate devices running Junos OS\u201d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u043a\u0430\u043a \u043c\u044b \u043b\u044e\u0431\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0439 \u2014 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Python \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS. \u0412\u044b\u0431\u043e\u0440 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-54367","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0421\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Junos PyEZ \u2014 \u201cPython microframework that enables you to manage and automate devices running Junos OS\u201d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u043a\u0430\u043a \u043c\u044b \u043b\u044e\u0431\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0439 \u2014 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Python \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS. \u0412\u044b\u0431\u043e\u0440\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/junos-pyez-na-primere-zadachi-po-poisku-svobodnyh-podsetej-ipv4\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Junos PyEZ \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 ipv4 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0421\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Junos PyEZ \u2014 \u201cPython microframework that enables you to manage and automate devices running Junos OS\u201d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u043a\u0430\u043a \u043c\u044b \u043b\u044e\u0431\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0439 \u2014 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Python \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS. \u0412\u044b\u0431\u043e\u0440\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/junos-pyez-na-primere-zadachi-po-poisku-svobodnyh-podsetej-ipv4\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-12-23T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:02:22+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Junos PyEZ \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 ipv4 | ProHoster","description":"\u0421\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Junos PyEZ \u2014 \u201cPython microframework that enables you to manage and automate devices running Junos OS\u201d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u043a\u0430\u043a \u043c\u044b \u043b\u044e\u0431\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0439 \u2014 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Python \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS. \u0412\u044b\u0431\u043e\u0440","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/junos-pyez-na-primere-zadachi-po-poisku-svobodnyh-podsetej-ipv4","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Junos PyEZ \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 ipv4 | ProHoster","og:description":"\u0421\u0442\u0430\u0442\u044c\u044f \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Junos PyEZ \u2014 \u201cPython microframework that enables you to manage and automate devices running Junos OS\u201d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u043a\u0430\u043a \u043c\u044b \u043b\u044e\u0431\u0438\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0439 \u2014 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 Python \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Junos OS. \u0412\u044b\u0431\u043e\u0440","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/junos-pyez-na-primere-zadachi-po-poisku-svobodnyh-podsetej-ipv4","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-12-23T21:00:00+00:00","article:modified_time":"2020-02-18T11:02:22+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"54367","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-24 11:06:21","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 20:07:25","updated":"2026-01-24 11:06:21"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/54367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=54367"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/54367\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=54367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=54367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=54367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}