티스토리 뷰

 - 설치와 실행은 Ubuntu + bash SHELL에서의 기준입니다.

 - Ansible, SaltStack, StackkStrom에서도 네이팜(NAPALM) 사용이 가능합니다.

 

 

 - 현재까지 지원되는 벤더의 종류와 OS의 종류는 적습니다. ( 시스코 및 주니퍼 )

General support matrix

_EOSJunosIOS-XRNX-OSNX-OS SSHIOS
Driver Name eos junos iosxr nxos nxos_ssh ios
Structured data Yes Yes No Yes No No
Minimum version 4.15.0F 12.1 5.1.0 6.1 [1]   12.4(20)T
Backend library pyeapi junos-eznc pyIOSXR pynxos netmiko netmiko
Caveats EOS     NXOS NXOS IOS

 

 

 - 지원되는 GET Matrix 종류입니다.

Getters support matrix

Note

The following table is built automatically. Every time there is a release of a supported driver a built is triggered. The result of the tests are aggregated on the following table.

  EOS IOS IOSXR JUNOS NXOS NXOS_SSH
get_arp_table
get_bgp_config
get_bgp_neighbors
get_bgp_neighbors_detail
get_config
get_environment
get_facts
get_firewall_policies
get_interfaces
get_interfaces_counters
get_interfaces_ip
get_ipv6_neighbors_table
get_lldp_neighbors
get_lldp_neighbors_detail
get_mac_address_table
get_network_instances
get_ntp_peers
get_ntp_servers
get_ntp_stats
get_optics
get_probes_config
get_probes_results
get_route_to
get_snmp_information
get_users
is_alive
ping
traceroute
  • ✅ - supported
  • ❌ - not supported
  • ☠ - broken

 

 

 

 

[INSTALL]

설치 과정은 상당히 간단합니다.

주의사항으로는 pip 버전에 따라 설치오류가 나올 수 있으니 pip upgrade를 권장합니다. 

 

- python pip 설치

root# sudo apt install python && sudo apt install python3

 

 - napalm 설치

root# pip install napalm

 

 

[사용 방법]

사용 방법도 어렵진 않습니다. 아래는 샘플입니다.

 

Form)

napalm --vendor [vendor] --user [username] --password [password] --optional_args 'port=22, config_lock=False' [hostname] call [get_matrix]

example1) mac-address-table 출력

root# napalm --vendor JUNOS --user admin --password 'test123!!' --optional_args 'port=22, config_lock=False' '10.20.75.2' call get_mac_address_table

[
    {
        "vlan": 100,
        "static": false,
        "interface": "ae1.0",
        "active": true,
        "moves": 0,
        "mac": "3C:A8:2A:11:22:33",
        "last_move": 0.0
    },
    {
        "vlan": 100,
        "static": false,
        "interface": "ae2.0",
        "active": true,
        "moves": 0,
        "mac": "3C:A8:2A:44:55:66",
        "last_move": 0.0
    },



 

example2) arp table 출력
napalm --vendor junos --user admin --password 'test123!!' --optional_args 'port=22, config_lock=False' '10.70.25.2' call get_arp_table

[
    {
        "interface": "irb.100 [ae48.0]",
        "ip": "10.20.75.2",
        "mac": "02:E0:52:11:22:33",
        "age": 297.0
    },
    {
        "interface": "irb.100 [ae48.0]",
        "ip": "10.20.75.3",
        "mac": "CC:4E:24:44:55:66",
        "age": 155.0
    },
    {
        "interface": "irb.100 [ae48.0]",
        "ip": "10.20.75.4",
        "mac": "CC:4E:24:aa:bb:cc",
        "age": 58.0
    },

 

example3) interface 정보

napalm --vendor junos --user admin --password 'test123!!' --optional_args 'port=22, config_lock=False' '10.70.25.2' call get_interfaces_ip

{
    "irb.100": {
        "ipv4": {
            "10.20.75.2": {
                "prefix_length": 24
            }
        }
    },
    "irb.200": {
        "ipv4": {
            "172.20.75.2": {
                "prefix_length": 27
            }
        }
    },

 

example4) interface-counts 정보

napalm --vendor junos --user admin --password 'test123!!' --optional_args 'port=22, config_lock=False' '10.70.25.2' call get_interfaces_counters

{
    "xe-1/0/40": {
        "tx_broadcast_packets": 0,
        "tx_octets": 0,
        "rx_discards": 0,
        "tx_discards": 0,
        "rx_errors": 0,
        "tx_errors": 0,
        "rx_multicast_packets": 0,
        "tx_unicast_packets": 0,
        "rx_octets": 0,
        "rx_unicast_packets": 0,
        "rx_broadcast_packets": 0,
        "tx_multicast_packets": 0
    },
    "xe-1/0/20": {
        "tx_broadcast_packets": 0,
        "tx_octets": 578855671,
        "rx_discards": 0,
        "tx_discards": 0,
        "rx_errors": 0,
        "tx_errors": 0,
        "rx_multicast_packets": 0,
        "tx_unicast_packets": 0,
        "rx_octets": 2076,
        "rx_unicast_packets": 0,
        "rx_broadcast_packets": 6,
        "tx_multicast_packets": 4299072
    },

 

이외에도 많은 정보들을 Matrix를 통하여 GET 할 수 있습니다.

 

 

[전체적인 평]

자동화 툴을 즐겨 쓰는 저로서는 나쁘지 않은 경험이었습니다.

다만, 네이팜(NAPALM)을 사용시에 GET에 대한 matrix 부분이 한정적이며, 지원되는 OS도 시스코와 주니퍼의 OS만 지원된다는 점이 아쉬웠습니다.

앤서블(Ansible)과 솔트스택(Saltstack), 베이그란트(Vagrant) 등 이외 오케스트레이션 IaaC툴에서 함께 사용이 가능하지만, 네이팜 자체로만 놓고 보았을때는 차라리 파이썬 혹은 Bash나 Ansible로 자동화를 구현하는 게 훨씬 더 이점이 많다고 생각이 들었습니다.

잠깐 찾아보니 2015년즈음에 구상하고 2017년에 정식 시작된 것으로 보여, 시간이 지나면서 많은 부분이 보충되고 추가될 것으로 기대하고 있습니다.

 

 

 

github : https://github.com/napalm-automation/napalm

공식 : https://napalm.readthedocs.io/en/latest/support/index.html#optional-arguments

 

Supported Devices — NAPALM 1 documentation

Warning Before building a workflow to deploy configuration it is important you understand what the table above means; what are atomic changes and which devices support it, what does replacing or merging configuration mean, etc. The key to success is to tes

napalm.readthedocs.io

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함