Bahkan dalam jaringan yang baik, dari sudut pandang desain, dari waktu ke waktu perlu untuk melakukan pekerjaan memperbarui konfigurasi entitas tertentu. Di antara alasan yang paling menarik dan diantisipasi untuk kegiatan tersebut, migrasi dapat dicatat untuk mengoordinasikan bidang fisik dan logis, pengembangan jaringan sebagai bagian dari proses evolusi teknologi, harmonisasi arsitektur dari segmen yang terhubung dan solusi dari masalah pertumbuhan. Faktanya, siklus hidup suatu jaringan hampir selalu terdiri dari perubahan dengan satu atau lebih tingkat risiko dan efek menyeluruh pada layanan, di mana penilaian faktor manusia tidak dapat diabaikan. Meskipun akan sangat tepat untuk menggeneralisasikan deskripsi ini ke sebagian besar bidang aktivitas manusia, berfungsinya jaringan komunikasi memiliki beberapa fitur yang pantas dipahami, atau setidaknya diperhatikan, - elemen-elemen jaringan komunikasi dalam komunikasi yang ketat, berinteraksi erat dan membuat tidak hanya langsung, tetapi juga tidak langsung berdampak satu sama lain. Oleh karena itu, strategi yang kompeten dari pekerjaan yang sedang berjalan hanya akan menjadi lebih produktif jika didukung oleh mekanisme yang sejauh mungkin mengurangi kemungkinan kesalahan manusia. Dalam artikel selanjutnya dari seri
"Mengapa program insinyur jaringan", saya akan berbicara tentang opsi untuk menggunakan otomatisasi dalam satu tugas semacam ini.
Dalam banyak "primer" pada arsitektur jaringan, istilah jaringan skala besar dan jaringan hierarkis digunakan hampir secara sinonim, berkenaan dengan desain domain IGP, desain sederhana dan, pada pandangan pertama, dapat dimengerti diindikasikan - memecah domain menjadi domain. Pada saat yang sama, ambang saturasi adalah hal yang murni individual, dalam beberapa kasus, seribu router modern biasanya dapat hidup berdampingan dalam satu area IGP, jika tidak tiga ratus cukup untuk secara signifikan mengurangi karakteristik operasional. Sebagian besar, ambang batas ini ditentukan oleh protokol yang diberlakukan pada IGP, oleh karena itu, dalam kondisi beberapa variabilitas dan ketidakpastian batas dan skala jaringan masa depan, "bison" industri menemukan cara yang lebih fleksibel untuk membangun domain datar dengan migrasi selanjutnya dari bagian-bagian yang terbentuk ke area terpisah. Dengan kata lain, jika Anda tidak dapat "melihat besok besok", bangun jaringan datar dan bagilah dengan munculnya tanda-tanda pertama penurunan waktu konvergensi atau kompleksitas eksploitasi yang berlebihan, karena tidak adanya hierarki masih lebih baik daripada yang salah yang dipilih dengan ketidakpastian. struktur [1, 2, 3].
Cukup gambaran umum dan contoh-contoh abstrak, misalkan kita berhadapan dengan wilayah yang terlalu banyak pada domain OSPFv2, topologi dari serat / saluran fisik yang sudah memungkinkan untuk melihat batas-batas daerah di masa depan dalam struktur amorf. Saya bukan pendukung mengubah sesuatu berdasarkan prinsip “semua atau tidak sama sekali”, mungkin terjadi karena keadaan yang tidak terduga, ruang peluang akan menjadi terlalu sempit, dan risiko yang diharapkan terlalu besar. Mengubah wilayah OSPFv2 adalah operasi yang merusak, oleh karena itu skema proses migrasi yang paling mudah, yang terdiri dari pengalihan router secara berurutan ke wilayah baru di sepanjang jalan dari perbatasan masa depan ke bawah, jauh lebih nyaman di semua topologi. Untungnya, beberapa waktu lalu, dalam rekomendasi untuk pengembangan OSPF, kemungkinan membangun konektivitas di beberapa area diuraikan [4]. Dengan menggunakan kesempatan ini, kami dapat membagi migrasi menjadi tiga tahap:
- Membangun konektivitas tambahan (sekunder) di area baru
- Transfer area baru ke mode utama, dan yang lama ke area tambahan
- Menghapus konektivitas dalam lingkup lama
Pada tahap pertama, topologi wilayah baru berangsur-angsur meluas, pada tahap kedua, topologi wilayah lama semakin menyempit. Tunduk pada kongruensi topologi area lama dan baru, kami memperoleh rute yang konsisten antara node yang diterjemahkan dan yang tidak diterjemahkan, dan ini, pada gilirannya, memungkinkan untuk membagi tahapan menjadi sub-tahap independen, di mana masing-masing pekerjaan dapat dilakukan dengan beberapa bagian dari node. Dianjurkan untuk mendekati pilihan node untuk bekerja dalam kerangka sub-tahap dari sudut pandang pemanfaatan aktual saluran dalam jaringan tertentu sehingga untuk mencegah reload di perbatasan area lama dan baru. Terlepas dari kenyataan bahwa artikel ini ditujukan untuk pemrograman, saya pikir tidak akan berlebihan untuk mengatakan beberapa kata tentang perilaku protokol yang diterapkan pada IGP dalam konteks perubahan domain. LDP berperilaku cukup mudah ditebak, terjemahan lancar dicapai dengan menyediakan konektivitas IP antara target alamat transportasi dan sesi. Karena fakta bahwa BGP adalah protokol yang sangat fleksibel, Anda harus memperhatikan pesawat ini. Baik jika BGP tidak memperkenalkan kebebasan khusus pada node yang diterjemahkan dalam bentuk perubahan dalam Preferensi Lokal atau kriteria lain yang menentukan keputusan rute lokal yang tidak konsisten antara node. Dengan kata lain, perilaku BGP juga dapat diprediksi jika pemilihan rute di wilayah tersebut tidak bertentangan dengan aturan jalur IGP. Ada titik halus yang terkait dengan pekerjaan RSVP selama periode waktu koeksistensi dua area. Fakta mengisi tabel TED dari dua sumber dengan visibilitas yang berbeda memunculkan pemikiran, misalnya, Anda mungkin kehilangan mekanisme FRR sampai pekerjaan selesai. Ini dapat terjadi jika router dengan visibilitas lebih tinggi, yang berada di dua area, menghitung ERO melalui router dengan visibilitas yang lebih rendah, mis. melalui segmen jaringan yang diterjemahkan tanpa informasi topologi tentang area lain. Ini tidak bisa disebut bencana, karena jalan akhirnya akan dibangun, tetapi Anda tidak boleh melupakannya. Seni khusus memerlukan menggabungkan pekerjaan memperkenalkan hierarki IGP dengan jenis pekerjaan yang sama di pesawat BGP, misalnya, dengan memigrasikan jala penuh ke reflektor rute. Pengenalan hierarki di pesawat yang berbeda lebih baik dilakukan secara berurutan, hal yang sama, menurut saya, berlaku untuk semua hal yang menyembunyikan informasi routing, peringkasan lebih mudah untuk dibangun di atas fondasi IGP hirarki yang stabil daripada menggabungkan tahapan-tahapan ini.
Jadi, kami memiliki rencana umum, dan jika Anda belum berubah pikiran, mari kita pikirkan implementasi perangkat lunak pada Pyez, sesuatu seperti ini dalam gambar.

Setiap oval yang indah dapat berupa entitas perangkat lunak yang terpisah, mis. suatu hal yang berfungsi dan menyiapkan data untuk langkah selanjutnya. Data awal berarti informasi dari jaringan, misalnya, untuk menyiapkan konfigurasi area OSPF baru, Anda perlu mendapatkan nama-nama antarmuka aktif milik area lama dan bobotnya, yang berarti bahwa kita akan memerlukan keterampilan dalam bekerja dengan tabel dan tampilan Operasi. Konsep-konsep ini dapat ditemukan di artikel sebelumnya dalam seri
"Programming for Network Engineers: The First Case" . Pada tahap pertama, generator menyimpan dalam file perintah yang diperlukan untuk mengaktifkan area baru, pada tahap kedua - untuk menghapus yang lama dan memindahkan yang baru ke mode utama, pada tahap ketiga - perintah untuk menghapus area yang lama. Ke depan, saya akan mengatakan bahwa untuk artikel ini saya sengaja tidak menggunakan visualisator template seperti Jinja2. Agar tidak teralihkan dari topik target, kode ditulis sesederhana mungkin. Jika seseorang tertarik pada dokumentasi di tautan
"Dokumentasi Jinja2" .
Langkah Konfigurasi Kode Generasiimport sys import yaml from jnpr.junos.factory.factory_loader import FactoryLoader from jnpr.junos import Device def getConnection(p_host, p_user): acc = {'lab': 'lab123'} try: print ' DEBUG --- getting ssh connection to ' + p_host l_dev = Device(host=p_host, user=p_user, password=acc[p_user], auto_probe=2, gather_facts=True, port=22) l_dev.open() if (l_dev.connected): l_dev.timeout = 900 print ' DEBUG --- ssh cionnection to host ' + p_host + ' established' print ' DEBUG --- connection ' + p_host + ' named ' + l_dev.facts['hostname'] + ' established ' return l_dev else: raise Exception(' DEBUG --- ssh connection to ' + p_host + ' was not established') except Exception as ex: print ' DEBUG --- ERROR --- getConnection : connection to ' + p_host + ' was not established. ex:' + str(ex) return def close_dev(d): try: d.close() except Exception as ex: print ' DEBUG --- ERROR --- close_dev : connection to cant be closed. ex:' + str(ex) yml = ''' --- OSPFInterface: rpc: get-ospf-interface-information args: area: '0.0.0.200' detail: True item: ospf-interface view: OSPFInterfaceView OSPFInterfaceView: fields: name: interface-name type: interface-type cost: interface-cost ''' globals().update(FactoryLoader().load(yaml.load(yml))) node_list = ['10.83.20.68', '10.83.20.69', '10.83.20.70', '10.83.20.71'] abr_list = ['10.83.20.66', '10.83.20.67'] for node in node_list + abr_list: ddev = getConnection(node, 'lab') ospf_interfaces = OSPFInterface(ddev).get() with open('st1-' + node + '.txt', "w") as f_st1: for ospf_interface in ospf_interfaces: if ( 'ge' in ospf_interface.name ): f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' secondary' + '\n') f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' interface-type p2p' + '\n') f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' metric ' + ospf_interface.cost + '\n') with open('st2-' + node + '.txt', "w") as f_st1: f_st1.write('delete protocols ospf area 0.0.0.200' + '\n') f_st1.write('delete protocols ospf area 0.0.0.250' + '\n') for ospf_interface in ospf_interfaces: f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' interface-type p2p' + '\n') f_st1.write('set protocols ospf area 0.0.0.200 interface ' + ospf_interface.name + ' secondary' + '\n') f_st1.write('set protocols ospf area 0.0.0.200 interface ' + ospf_interface.name + ' interface-type p2p' + '\n') if (ospf_interface.cost != '0'): f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' metric ' + ospf_interface.cost + '\n') f_st1.write('set protocols ospf area 0.0.0.200 interface ' + ospf_interface.name + ' metric ' + ospf_interface.cost + '\n') with open('st3-' + node + '.txt', "w") as f_st1: f_st1.write('delete protocols ospf area 0.0.0.200' + '\n')
Untuk kejelasan, saya disatukan dalam jaringan seperti itu di vMX.

vMX adalah router perangkat lunak berfitur lengkap dari Juniper Networks, yang sebagian besar mengulangi perilaku kakak besinya, MX Iron. Bukannya itu adalah produk yang perlu diperkenalkan, itu hanya berguna untuk menjaga hal-hal ini berguna untuk latihan pemrograman atau tes laboratorium.
Uji coba dapat diunduh di sini
"Unduhan Percobaan vMX" , dan instruksi pemasangan pada tautan ini
"Mempersiapkan Sistem untuk Menginstal vMX" .
Router bb, abr1 dan abr2 membentuk daerah nol, router r1, r2, r3 dan r4 - harus dipindahkan dari wilayah ke-200 ke ke-250.
lab @ bb> tampilkan protokol konfigurasi bgp { group int { type internal; local-address 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.0 { interface lo0.0 { passive; } interface ge-0/0/3.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } } }
lab @ abr1> tampilkan protokol konfigurasi bgp { group int { type internal; local-address 10.0.0.66; neighbor 10.0.0.65; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.0 { interface lo0.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface ge-0/0/0.0 { interface-type p2p; } } area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } } }
lab @ abr2> tampilkan protokol konfigurasi bgp { group int { type internal; local-address 10.0.0.67; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.0 { interface lo0.0 { interface-type p2p; } interface ge-0/0/0.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } } area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } } }
lab @ r1> tampilkan protokol konfigurasi bgp { group int { type internal; local-address 10.0.0.68; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
lab @ r2> tampilkan protokol konfigurasi bgp { group int { type internal; local-address 10.0.0.69; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.200 { interface ge-0/0/0.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
lab @ r3> tampilkan protokol konfigurasi bgp { group int { type internal; local-address 10.0.0.70; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.71; } } ospf { area 0.0.0.200 { interface ge-0/0/0.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
lab @ r4> tampilkan protokol konfigurasi bgp { group int { type internal; local-address 10.0.0.71; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; } } ospf { area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
Untuk router r2, serangkaian perintah berikut akan dihasilkan.
Untuk tahap pertamamengatur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 1.0 sekunder
atur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 1.0 antarmuka-tipe p2p
setel protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 1.0 metrik 1
atur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 2.0 sekunder
atur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 2.0 antarmuka-tipe p2p
setel protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 2.0 metrik 1
mengatur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 3.0 sekunder
atur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 3.0 antarmuka-tipe p2p
setel protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 3.0 metrik 1
Untuk tahap keduahapus protokol area ospf 0.0.0.200
hapus protokol area ospf 0.0.0.250
atur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 1.0 antarmuka-tipe p2p
mengatur protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 1.0 sekunder
set protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 1.0 antarmuka-tipe p2p
setel protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 1.0 metrik 1
setel protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 1.0 metrik 1
atur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 2.0 antarmuka-tipe p2p
mengatur protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 2.0 sekunder
atur protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 2.0 antarmuka-tipe p2p
setel protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 2.0 metrik 1
setel protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 2.0 metrik 1
atur protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 3.0 antarmuka-tipe p2p
mengatur protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 3.0 sekunder
atur protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 3.0 antarmuka-tipe p2p
setel protokol area ospf 0.0.0.250 antarmuka ge-0/0 / 3.0 metrik 1
setel protokol area ospf 0.0.0.200 antarmuka ge-0/0 / 3.0 metrik 1
atur protokol area ospf 0.0.0.250 antarmuka lo0.0 antarmuka-tipe p2p
mengatur protokol area ospf 0.0.0.200 antarmuka lo0.0 sekunder
set protokol area ospf 0.0.0.200 antarmuka lo0.0 antarmuka-tipe p2p
Untuk tahap ketigahapus protokol area ospf 0.0.0.200
Seperti yang sudah saya tulis, elemen-elemen jaringan memiliki keadaan internal, sekitar dan di dalamnya sesuatu yang terus-menerus terjadi terlepas dari apakah kita menginginkannya atau tidak. Terjadinya peristiwa seperti kegagalan transceiver, pemadaman listrik pada sebuah node, atau putusnya saluran optik harus diperhitungkan begitu saja dan diperhitungkan selama bekerja. Saya mengusulkan untuk memperhatikan fakta ini dalam konteks pilihan verifikasi keberhasilan tahapan migrasi. Tidak peduli seberapa paradoksal ini terdengar, dalam hal ini tidak perlu bagi kita untuk memeriksa apakah lingkungan OSPF muncul pada antarmuka ini atau itu, karena alasan ketidakhadirannya dapat berada di pesawat yang sama sekali berbeda. Selain hal di atas, kesalahan atau ketidaktepatan selalu dapat masuk ke sumber data, misalnya, dalam bentuk antarmuka yang terlupakan yang harus dihapus, tetapi saat ini sedang mencari ke dalam "void". Dalam proses menghasilkan cek, penting untuk naik satu tingkat untuk melihat jaringan dari sudut pandang layanan yang diberikan dan protokol yang diberlakukan, karena pada akhirnya keadaan hanya hal-hal ini memungkinkan Anda untuk membuat keputusan tentang keberhasilan tahap tertentu. Beberapa pelanggan setuju dengan artikel publik berdasarkan hasil pekerjaan mereka, itulah sebabnya saya mengumpulkan lingkungan virtual untuk demonstrasi. Dalam lingkungan ini, saya akan membatasi diri untuk memeriksa status sesi BGP, yang dibangun atas dasar satu-ke-satu antara router, ini akan menjadi layanan yang diberlakukan, dan layanan kami. Jika, setelah bekerja, kondisi untuk kinerjanya terpenuhi dalam bentuk konektivitas IP masing-masing, maka ada alasan untuk percaya bahwa pekerjaan itu berhasil. Dalam proyek nyata, cek biasanya terbatas pada volume layanan dan protokol yang diberlakukan, yang ditetapkan sebagai kritis bisnis dalam jaringan tertentu. Ini tidak berlaku untuk pemrograman, namun, saya tidak bisa tidak fokus pada masalah ini, karena pilihan kriteria keberhasilan adalah kunci untuk tidur yang baik setelah pekerjaan selesai.
Kode Verifikasi Sesi BGP import sys import yaml from jnpr.junos.factory.factory_loader import FactoryLoader from jnpr.junos import Device def getConnection(p_host, p_user): acc = {'lab': 'lab123'} try: print ' DEBUG --- getting ssh connection to ' + p_host l_dev = Device(host=p_host, user=p_user, password=acc[p_user], auto_probe=2, gather_facts=True, port=22) l_dev.open() if (l_dev.connected): l_dev.timeout = 900 print ' DEBUG --- ssh cionnection to host ' + p_host + ' established' print ' DEBUG --- connection ' + p_host + ' named ' + l_dev.facts['hostname'] + ' established ' return l_dev else: raise Exception(' DEBUG --- ssh connection to ' + p_host + ' was not established') except Exception as ex: print ' DEBUG --- ERROR --- getConnection : connection to ' + p_host + ' was not established. ex:' + str(ex) return def close_dev(d): try: d.close() except Exception as ex: print ' DEBUG --- ERROR --- close_dev : connection to cant be closed. ex:' + str(ex) ip_f_name = 'ip-list-1.txt' yml = ''' --- BGPGroup: rpc: get-bgp-group-information args: group-name: 'int' item: bgp-group view: BGPGroupView BGPGroupView: fields: count: peer-count established: established-count ''' globals().update(FactoryLoader().load(yaml.load(yml))) node_list = ['10.83.20.68', '10.83.20.69', '10.83.20.70', '10.83.20.71'] abr_list = ['10.83.20.66', '10.83.20.67'] for node in node_list + abr_list: ddev = getConnection(node, 'lab') bgp_group = BGPGroup(ddev).get() for group in bgp_group: if (group.count != group.established): print 'bgp connection lost' else: print 'dont panic!'
Hasil karyanyaDEBUG - mendapatkan koneksi ssh ke 10.83.20.68
DEBUG - ssh cionnection menjadi tuan rumah 10.83.20.68 didirikan
DEBUG - koneksi 10.83.20.68 bernama r1 didirikan
jangan panik!
DEBUG - mendapatkan koneksi ssh ke 10.83.20.69
DEBUG - ssh cionnection menjadi tuan rumah 10.83.20.69 didirikan
DEBUG - koneksi 10.83.20.69 bernama r2 didirikan
jangan panik!
DEBUG - mendapatkan koneksi ssh ke 10.83.20.70
DEBUG - ssh cionnection menjadi tuan rumah 10.83.20.70 didirikan
DEBUG - koneksi 10.83.20.70 bernama r3 didirikan
jangan panik!
DEBUG - mendapatkan koneksi ssh ke 10.83.20.71
DEBUG - ssh cionnection menjadi tuan rumah 10.83.20.71 didirikan
DEBUG - koneksi 10.83.20.71 bernama r4 didirikan
jangan panik!
DEBUG - mendapatkan koneksi ssh ke 10.83.20.66
DEBUG - ssh cionnection menjadi tuan rumah 10.83.20.66 didirikan
DEBUG - koneksi 10.83.20.66 bernama abr1 didirikan
jangan panik!
DEBUG - mendapatkan koneksi ssh ke 10.83.20.67
DEBUG - ssh cionnection menjadi tuan rumah 10.83.20.67 didirikan
DEBUG - koneksi 10.83.20.67 bernama abr2 didirikan
jangan panik!
Hingga saat ini, kami lebih banyak berbicara tentang beberapa hal jaringan, tetapi saya masih belum mengatakan sepatah kata pun tentang kode program, yang tampaknya menjadi pusat perhatian dalam sebuah artikel dengan nama ini. Pertama, menurut saya pemikiran jauh lebih penting daripada kode, setelah memformalkan entitas di kepala, seorang insinyur akan dapat mengubahnya menjadi alat dan menyatakannya dalam bentuk kode. Kedua, saya tidak ingin mengulang sendiri, segala sesuatu yang mungkin tidak tampak jelas dalam contoh-contoh ini, serta pengetahuan minimum yang diperlukan untuk mulai bekerja dengan Python dan Pyez, terkandung dalam artikel sebelumnya dalam seri. Ketiga, kode persiapan konfigurasi melakukan pekerjaannya, yang disebut offline dan tidak memiliki efek langsung pada jaringan, sehingga tidak mungkin menimbulkan minat. Hal-hal agak berbeda dengan kode implementasi fase implementasi, pengembangan prosedur ini menimbulkan pertanyaan berikut:
- Bagaimana memeriksa bahwa seluruh volume perintah diterima dengan baik oleh penerjemah?
- Bagaimana cara memverifikasi bahwa perubahan yang dilakukan pada konfigurasi telah diterapkan?
- Bagaimana cara menerapkan skema konfigurasi transaksional?
- Bagaimana cara mengembalikan konfigurasi jika kehilangan kontrol?
- Bagaimana cara membersihkan jika penerjemah melaporkan kesalahan selama transfer perintah?
Semakin banyak perhatian diberikan pada masalah-masalah ini, semakin sedikit kejutan akan disajikan pada tahap eksekusi. Bayangkan kerumitan kesalahan sintaks yang menggambarkan kebijakan perutean ketika pengklasifikasi kebijakan ini hanya disetujui sebagian oleh penerjemah. Jika Anda tidak mengontrol baris demi baris proses penggabungan kebijakan ini dengan konfigurasi saat ini, Anda dapat menempatkan tumpukan peralatan ke kondisi tidak memadai dengan satu klik tombol. Oleh karena itu, saya mematuhi kira-kira seperti blok diagram tahap eksekusi.

Dipersenjatai dengan dokumentasi
Pyez , kode loader konfigurasi universal berikut dikompilasi, yang dapat Anda gunakan dalam pekerjaan sehari-hari, sama seperti saya menggunakannya di tambang.
conf_change.py import sys import yaml from jnpr.junos.factory.factory_loader import FactoryLoader from jnpr.junos import Device from jnpr.junos.utils.config import Config import copy import re import traceback import time import random from jnpr.junos.exception import * import os.path yml = ''' --- VersionInfo: rpc: get-software-information item: software-information view: VersionInfoView VersionInfoView: fields: name: host-name ''' Device.auto_probe = 3 ip_f_name = 'ip-list-1.txt' cur_stage='2' globals().update(FactoryLoader().load(yaml.load(yml))) def doTestOSPF(p_dev, p_node, f_do): print ' DEBUG --- doTestOSPF : at ' + p_node if ( p_dev == None ): print ' DEBUG --- ERROR --- doTestOSPF : connection to ' + p_node + ' is None' return else: try: d_conf = p_dev.cli("show configuration | display set").split('\n') ret_val = True set_found = 0 c_path = 'st' + cur_stage + '-' + p_node + '.txt' with open(c_path, "r") as f: for line in f: c_line = line.replace('\n', '').replace('\r\n', '') if ('delete ' not in c_line): set_found = 1 if ( (c_line not in d_conf) and (c_line != '')): print ' DEBUG --- doTestOSPF found missing line ' + c_line ret_val = False f.close() if ( (set_found == 0) and (f_do == True) ): return False return ret_val except Exception as ex: print ' DEBUG --- ERROR --- doTestOSPF : connection to ' + p_node + ' was not established. ex:' + str(ex) return def doTest(p_dev, p_node, f_do): return doTestOSPF(p_dev, p_node, f_do) def close_dev(d): try: d.close() except Exception as ex: print ' DEBUG --- ERROR --- close_dev : connection to cant be closed. ex:' + str(ex) def getConnection(p_host, p_user): acc = {'lab': 'lab123'} try: print ' DEBUG --- getting ssh connection to ' + p_host l_dev = Device(host=p_host, user=p_user, password=acc[p_user], auto_probe=2, gather_facts=True, port=22) l_dev.open() if (l_dev.connected): l_dev.timeout = 900 print ' DEBUG --- ssh cionnection to host ' + p_host + ' established' v = VersionInfo(l_dev).get() print ' DEBUG --- connection ' + p_host + ' named ' + l_dev.facts['hostname'] + ' established ' return l_dev else: raise Exception(' DEBUG --- ssh connection to ' + p_host + ' was not established') except Exception as ex: print ' DEBUG --- ERROR --- getConnection : connection to ' + p_host + ' was not established. ex:' + str(ex) traceback.print_exc() return def doCompare(p_conf, p_node): try: print ' DEBUG --- doCompare at ' + p_node if ( p_conf.diff() == None ): return False else: return True except Exception as ex: print ' DEBUG --- ERROR --- doCompare : conf.diff at ' + p_node + ' ex:' + str(ex) return def doLoad(p_conf, p_node): try: print ' DEBUG --- doLoad at ' + p_node c_path = 'st' + cur_stage + '-' + p_node + '.txt' if (os.path.isfile(c_path)): p_conf.load(path=c_path, format='set') return True except Exception as ex: print ' DEBUG --- ERROR --- doLoad : cant load config to ' + p_node + ' ex:' + str(ex) return def doRollback(p_conf, p_node, p_r): try: print ' DEBUG --- doRollback at ' + p_node if ( p_conf.rollback(rb_id=p_r) == True ): return True else: return False except Exception as ex: print ' DEBUG --- ERROR --- doRollback : cant rollback config to ' + p_node + ' ex:' + str(ex) return None def doCommitCheck(p_conf, p_node): try: print ' DEBUG --- doCommitCheck at ' + p_node p_conf.commit_check() return True except Exception as ex: print ' DEBUG --- ERROR --- doCommitCheck : cant config commit check config to ' + p_node + ' ex:' + str(ex) return None def doCommit(p_conf, p_node, p_confirm_m=None): try: print ' DEBUG --- doCommit at ' + p_node commit_res = None if (p_confirm_m == None): commit_res = p_conf.commit(timeout=30) else: commit_res = p_conf.commit(confirm=p_confirm_m, timeout=30) if (commit_res == True): return True else: return False except CommitError as c_ex: print ' DEBUG --- ERROR --- doCommit : cant config commit at ' + p_node + ' ex:' + str(c_ex) return None except RpcTimeoutError as t_ex: print ' DEBUG --- ERROR --- doCommit : config was commited at ' + p_node + ' with the following ex:' + str(t_ex) return True def doJob(p_dev, p_node): print ' DEBUG --- doJob at ' + p_node if ( p_dev == None ): print ' DEBUG --- ERROR --- doJob : connection to ' + p_node + ' is None' return else: try: with Config(p_dev) as conf: is_compare = doCompare(conf, node) if ( is_compare == None ): print ' DEBUG --- ERROR --- doJob : at config compare ' + node return if ( is_compare == True ): print ' DEBUG --- ERROR --- doJob : configuration locked at ' + node return False print ' DEBUG --- starting to do config changes at ' + node if ( doLoad(conf, node) != True ): print ' DEBUG --- ERROR --- doJob : conf.load ' + node if ( doCompare(conf, node) != False ): print ' DEBUG --- doJob : doing rollback after load at ' + node + ' deleting :' + str(conf.diff()) doRollback(conf, node, 0) return print ' DEBUG --- commit check at ' + node if (doCommitCheck(conf, node) != True): print ' DEBUG --- ERROR --- doJob : conf.doCommitCheck failed at ' + node if ( doCompare(conf, node) != False ): print ' DEBUG --- doJob : doing rollback after load at ' + node + ' deleting :' + str(conf.diff()) doRollback(conf, node, 0) return commit_m = 5 print ' DEBUG --- commiting changes at ' + node if (doCommit(conf, node, commit_m) != True): print ' DEBUG --- ERROR --- doJob : conf.commit ' + node if ( doCompare(conf, node) != False ): print ' DEBUG --- doJob : doing rollback after commit at ' + node + ' deleting :' + str(conf.diff()) doRollback(conf, node, 0) return True except Exception as ex: print ' DEBUG --- ERROR --- doJob : cant do job ' + node + ' ex:' + str(ex) return node_list = [] result_list = {} with open(ip_f_name, "r") as f_ip: for line in f_ip: c_ip_line = line.replace('\n', '').replace('\r\n', '') if (c_ip_line != ''): node_list.append(c_ip_line) for node in node_list: print 'FLOW -- ************************************ ' print 'FLOW -- checking ' + node result_list.setdefault(node, {}) cur_dev = getConnection(node, 'lab') is_test = doTest(cur_dev, node, True) if( is_test == None): print 'FLOW -- error' result_list.setdefault(node, {}).setdefault('status', 'error') break if( is_test == True): print 'FLOW -- conf exist' result_list.setdefault(node, {}).setdefault('status', 'nn') if( is_test == False): print 'FLOW -- conf not exist, doing change' is_job = doJob(cur_dev, node) if( is_job == None): print 'FLOW -- cant do job at ' + node result_list.setdefault(node, {}).setdefault('status', 'error') break if( is_job == False): print 'FLOW -- cant do job at ' + node result_list.setdefault(node, {}).setdefault('status', 'not_done') if( is_job == True): print 'FLOW -- done job at ' + node print 'FLOW -- going sleep at ' + node time.sleep(5) print 'FLOW -- checking job status ' + node cur_dev_confirm = getConnection(node, 'lab') if ( cur_dev_confirm != None ): if (doTest(cur_dev, node, False) == True): print 'FLOW -- commiting the configuration at ' + node if (doCommit(Config(cur_dev_confirm), node) != True): print 'FLOW -- ERROR cant commit the configuration at ' + node result_list.setdefault(node, {}).setdefault('status', 'not_done') break else: print 'FLOW -- configuration commited at ' + node result_list.setdefault(node, {}).setdefault('status', 'done') else: print 'FLOW -- ERROR cant find conf after job ' + node result_list.setdefault(node, {}).setdefault('status', 'not_done') close_dev(cur_dev_confirm) else: print 'FLOW -- ERROR cant access ' + node + ' for commiting' result_list.setdefault(node, {}).setdefault('status', 'not_done') close_dev(cur_dev) print result_list
Dan hasil karyanya dalam tiga tahap
Teks tersembunyiPython 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
==== RESTART: C:\Users\and_andreev\Desktop\tools\lab-case2\conf_change.py ====
FLOW -- ************************************
FLOW -- checking 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.66
DEBUG --- doCompare at 10.83.20.66
DEBUG --- starting to do config changes at 10.83.20.66
DEBUG --- doLoad at 10.83.20.66
DEBUG --- commit check at 10.83.20.66
DEBUG --- doCommitCheck at 10.83.20.66
DEBUG --- commiting changes at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- done job at 10.83.20.66
FLOW -- going sleep at 10.83.20.66
FLOW -- checking job status 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- commiting the configuration at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- configuration commited at 10.83.20.66
FLOW -- ************************************
FLOW -- checking 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.67
DEBUG --- doCompare at 10.83.20.67
DEBUG --- starting to do config changes at 10.83.20.67
DEBUG --- doLoad at 10.83.20.67
DEBUG --- commit check at 10.83.20.67
DEBUG --- doCommitCheck at 10.83.20.67
DEBUG --- commiting changes at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- done job at 10.83.20.67
FLOW -- going sleep at 10.83.20.67
FLOW -- checking job status 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- commiting the configuration at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- configuration commited at 10.83.20.67
FLOW -- ************************************
FLOW -- checking 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.68
DEBUG --- doCompare at 10.83.20.68
DEBUG --- starting to do config changes at 10.83.20.68
DEBUG --- doLoad at 10.83.20.68
DEBUG --- commit check at 10.83.20.68
DEBUG --- doCommitCheck at 10.83.20.68
DEBUG --- commiting changes at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- done job at 10.83.20.68
FLOW -- going sleep at 10.83.20.68
FLOW -- checking job status 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- commiting the configuration at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- configuration commited at 10.83.20.68
FLOW -- ************************************
FLOW -- checking 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.69
DEBUG --- doCompare at 10.83.20.69
DEBUG --- starting to do config changes at 10.83.20.69
DEBUG --- doLoad at 10.83.20.69
DEBUG --- commit check at 10.83.20.69
DEBUG --- doCommitCheck at 10.83.20.69
DEBUG --- commiting changes at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- done job at 10.83.20.69
FLOW -- going sleep at 10.83.20.69
FLOW -- checking job status 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- commiting the configuration at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- configuration commited at 10.83.20.69
FLOW -- ************************************
FLOW -- checking 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.70
DEBUG --- doCompare at 10.83.20.70
DEBUG --- starting to do config changes at 10.83.20.70
DEBUG --- doLoad at 10.83.20.70
DEBUG --- commit check at 10.83.20.70
DEBUG --- doCommitCheck at 10.83.20.70
DEBUG --- commiting changes at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- done job at 10.83.20.70
FLOW -- going sleep at 10.83.20.70
FLOW -- checking job status 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- commiting the configuration at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- configuration commited at 10.83.20.70
FLOW -- ************************************
FLOW -- checking 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.71
DEBUG --- doCompare at 10.83.20.71
DEBUG --- starting to do config changes at 10.83.20.71
DEBUG --- doLoad at 10.83.20.71
DEBUG --- commit check at 10.83.20.71
DEBUG --- doCommitCheck at 10.83.20.71
DEBUG --- commiting changes at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- done job at 10.83.20.71
FLOW -- going sleep at 10.83.20.71
FLOW -- checking job status 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- commiting the configuration at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- configuration commited at 10.83.20.71
{'10.83.20.70': {'status': 'done'}, '10.83.20.71': {'status': 'done'}, '10.83.20.67': {'status': 'done'}, '10.83.20.66': {'status': 'done'}, '10.83.20.69': {'status': 'done'}, '10.83.20.68': {'status': 'done'}}
>>>
>>>
>>>
==== RESTART: C:\Users\and_andreev\Desktop\tools\lab-case2\conf_change.py ====
FLOW -- ************************************
FLOW -- checking 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.66
DEBUG --- doCompare at 10.83.20.66
DEBUG --- starting to do config changes at 10.83.20.66
DEBUG --- doLoad at 10.83.20.66
DEBUG --- commit check at 10.83.20.66
DEBUG --- doCommitCheck at 10.83.20.66
DEBUG --- commiting changes at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- done job at 10.83.20.66
FLOW -- going sleep at 10.83.20.66
FLOW -- checking job status 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- commiting the configuration at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- configuration commited at 10.83.20.66
FLOW -- ************************************
FLOW -- checking 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.67
DEBUG --- doCompare at 10.83.20.67
DEBUG --- starting to do config changes at 10.83.20.67
DEBUG --- doLoad at 10.83.20.67
DEBUG --- commit check at 10.83.20.67
DEBUG --- doCommitCheck at 10.83.20.67
DEBUG --- commiting changes at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- done job at 10.83.20.67
FLOW -- going sleep at 10.83.20.67
FLOW -- checking job status 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- commiting the configuration at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- configuration commited at 10.83.20.67
FLOW -- ************************************
FLOW -- checking 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.68
DEBUG --- doCompare at 10.83.20.68
DEBUG --- starting to do config changes at 10.83.20.68
DEBUG --- doLoad at 10.83.20.68
DEBUG --- commit check at 10.83.20.68
DEBUG --- doCommitCheck at 10.83.20.68
DEBUG --- commiting changes at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- done job at 10.83.20.68
FLOW -- going sleep at 10.83.20.68
FLOW -- checking job status 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- commiting the configuration at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- configuration commited at 10.83.20.68
FLOW -- ************************************
FLOW -- checking 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.69
DEBUG --- doCompare at 10.83.20.69
DEBUG --- starting to do config changes at 10.83.20.69
DEBUG --- doLoad at 10.83.20.69
DEBUG --- commit check at 10.83.20.69
DEBUG --- doCommitCheck at 10.83.20.69
DEBUG --- commiting changes at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- done job at 10.83.20.69
FLOW -- going sleep at 10.83.20.69
FLOW -- checking job status 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- commiting the configuration at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- configuration commited at 10.83.20.69
FLOW -- ************************************
FLOW -- checking 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.70
DEBUG --- doCompare at 10.83.20.70
DEBUG --- starting to do config changes at 10.83.20.70
DEBUG --- doLoad at 10.83.20.70
DEBUG --- commit check at 10.83.20.70
DEBUG --- doCommitCheck at 10.83.20.70
DEBUG --- commiting changes at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- done job at 10.83.20.70
FLOW -- going sleep at 10.83.20.70
FLOW -- checking job status 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- commiting the configuration at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- configuration commited at 10.83.20.70
FLOW -- ************************************
FLOW -- checking 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.71
DEBUG --- doCompare at 10.83.20.71
DEBUG --- starting to do config changes at 10.83.20.71
DEBUG --- doLoad at 10.83.20.71
DEBUG --- commit check at 10.83.20.71
DEBUG --- doCommitCheck at 10.83.20.71
DEBUG --- commiting changes at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- done job at 10.83.20.71
FLOW -- going sleep at 10.83.20.71
FLOW -- checking job status 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- commiting the configuration at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- configuration commited at 10.83.20.71
{'10.83.20.70': {'status': 'done'}, '10.83.20.71': {'status': 'done'}, '10.83.20.67': {'status': 'done'}, '10.83.20.66': {'status': 'done'}, '10.83.20.69': {'status': 'done'}, '10.83.20.68': {'status': 'done'}}
>>>
==== RESTART: C:\Users\and_andreev\Desktop\tools\lab-case2\conf_change.py ====
FLOW -- ************************************
FLOW -- checking 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.66
DEBUG --- doCompare at 10.83.20.66
DEBUG --- starting to do config changes at 10.83.20.66
DEBUG --- doLoad at 10.83.20.66
DEBUG --- commit check at 10.83.20.66
DEBUG --- doCommitCheck at 10.83.20.66
DEBUG --- commiting changes at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- done job at 10.83.20.66
FLOW -- going sleep at 10.83.20.66
FLOW -- checking job status 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- commiting the configuration at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- configuration commited at 10.83.20.66
FLOW -- ************************************
FLOW -- checking 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.67
DEBUG --- doCompare at 10.83.20.67
DEBUG --- starting to do config changes at 10.83.20.67
DEBUG --- doLoad at 10.83.20.67
DEBUG --- commit check at 10.83.20.67
DEBUG --- doCommitCheck at 10.83.20.67
DEBUG --- commiting changes at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- done job at 10.83.20.67
FLOW -- going sleep at 10.83.20.67
FLOW -- checking job status 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- commiting the configuration at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- configuration commited at 10.83.20.67
FLOW -- ************************************
FLOW -- checking 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.68
DEBUG --- doCompare at 10.83.20.68
DEBUG --- starting to do config changes at 10.83.20.68
DEBUG --- doLoad at 10.83.20.68
DEBUG --- commit check at 10.83.20.68
DEBUG --- doCommitCheck at 10.83.20.68
DEBUG --- commiting changes at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- done job at 10.83.20.68
FLOW -- going sleep at 10.83.20.68
FLOW -- checking job status 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- commiting the configuration at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- configuration commited at 10.83.20.68
FLOW -- ************************************
FLOW -- checking 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.69
DEBUG --- doCompare at 10.83.20.69
DEBUG --- starting to do config changes at 10.83.20.69
DEBUG --- doLoad at 10.83.20.69
DEBUG --- commit check at 10.83.20.69
DEBUG --- doCommitCheck at 10.83.20.69
DEBUG --- commiting changes at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- done job at 10.83.20.69
FLOW -- going sleep at 10.83.20.69
FLOW -- checking job status 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- commiting the configuration at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- configuration commited at 10.83.20.69
FLOW -- ************************************
FLOW -- checking 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.70
DEBUG --- doCompare at 10.83.20.70
DEBUG --- starting to do config changes at 10.83.20.70
DEBUG --- doLoad at 10.83.20.70
DEBUG --- commit check at 10.83.20.70
DEBUG --- doCommitCheck at 10.83.20.70
DEBUG --- commiting changes at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- done job at 10.83.20.70
FLOW -- going sleep at 10.83.20.70
FLOW -- checking job status 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- commiting the configuration at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- configuration commited at 10.83.20.70
FLOW -- ************************************
FLOW -- checking 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.71
DEBUG --- doCompare at 10.83.20.71
DEBUG --- starting to do config changes at 10.83.20.71
DEBUG --- doLoad at 10.83.20.71
DEBUG --- commit check at 10.83.20.71
DEBUG --- doCommitCheck at 10.83.20.71
DEBUG --- commiting changes at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- done job at 10.83.20.71
FLOW -- going sleep at 10.83.20.71
FLOW -- checking job status 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- commiting the configuration at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- configuration commited at 10.83.20.71
{'10.83.20.70': {'status': 'done'}, '10.83.20.71': {'status': 'done'}, '10.83.20.67': {'status': 'done'}, '10.83.20.66': {'status': 'done'}, '10.83.20.69': {'status': 'done'}, '10.83.20.68': {'status': 'done'}}
>>>
- Protokol Perutean IS-IS Lengkap - Hannes Gredler, Walter Goralski
- OSPF Anatomi Protokol Perutean Internet - John T. Moy
- Penggabungan dan Migrasi Jaringan: Desain dan Implementasi Junos - Gonzalo Gomez Herrero, Jan Anton Bernal Van Der Ven
- OSPF Multi-Area Adjacency - tools.ietf.org/html/rfc5185