Skip to content

nokia sros için araçlar

genel olarak network ekipmanlarında cli ile konfigürasyon yapıyorsanız sıklıkla kopyala – yapıştır yapıyorsunuzdur. ancak bu yöntem hatalara oldukça açıktır.

bu hatayı minimize etmek adına python ile yazılmış nokia sros güzel bir kod bulmuştum. bunu paylaşmak istedim. örnek için aşağıdaki şekilde bir konfigürasyonumuz olsun.. bunu c1.txt olarak kaydediyoruz.

        vpls 11 customer 1 vpn 11 i-vpls create
            backbone-vpls 100:11
            exit
            stp
                shutdown
            exit
            sap 1/5/1:11 create
            exit
            sap 1/5/1:12 create
            exit
            no shutdown
        exit
        vpls 100 customer 1 vpn 100 b-vpls create
            service-mtu 2000
            stp
                shutdown
            exit
            mrp
                flood-time 10
                no shutdown
            exit
            sap 1/5/1:100 create
            exit
            spoke-sdp 3101:100 create
            exit
            spoke-sdp 3201:100 create
            exit
            no shutdown
        exit

t.py olarak kaydettiğimiz python kodunu çalıştığımızda mevcut kodumuz aşağıdaki örnekte görüleceği üzere yeniden düzenleniyor. bu şekilde bir yapı bir çok olası hatanın önüne geçecektir.

fcicek@cicek:~/mpls/sros$ python t.py c1.txt
/configure vpls 11 customer 1 vpn 11 i-vpls create backbone-vpls 100:11
/configure vpls 11 customer 1 vpn 11 i-vpls create stp shutdown
/configure vpls 11 customer 1 vpn 11 i-vpls create sap 1/5/1:11 create
/configure vpls 11 customer 1 vpn 11 i-vpls create sap 1/5/1:12 create
/configure vpls 11 customer 1 vpn 11 i-vpls create no shutdown
/configure vpls 100 customer 1 vpn 100 b-vpls create service-mtu 2000
/configure vpls 100 customer 1 vpn 100 b-vpls create stp shutdown
/configure vpls 100 customer 1 vpn 100 b-vpls create mrp flood-time 10
/configure vpls 100 customer 1 vpn 100 b-vpls create mrp no shutdown
/configure vpls 100 customer 1 vpn 100 b-vpls create sap 1/5/1:100 create
/configure vpls 100 customer 1 vpn 100 b-vpls create spoke-sdp 3101:100 create
/configure vpls 100 customer 1 vpn 100 b-vpls create spoke-sdp 3201:100 create
/configure vpls 100 customer 1 vpn 100 b-vpls create no shutdown

kullanılan t.py

#!/usr/bin/env python3

import re
import math
import sys

def pop(stack):
    try:
        stack.pop()
    except Exception as err:
        print("ERROR: Unable to flush stack - %s" %err)

def output(stack):
    output = " ".join(stack)
    print(output)
    return output

def sros_flatten(data):
    stack = []
    exit_detected = False
    indent = 0
    new_conf = ""

    for line in data.lstrip().splitlines():
        l = len(line) - len(line.lstrip())
        nxt_indent = math.ceil(float(l/4))

        if line.startswith(("#", "echo")) or line.strip() == "":
            pass
        elif line.strip() == "exit all":
            new_conf = new_conf + "\n" + output(stack)
        else:
            if nxt_indent == 0 and line.strip() == "configure":
                new_line = str("/") + str(line.strip())
                stack.append(new_line)

            elif nxt_indent > indent:
                if line.strip() != "configure" and len(stack) == 0:
                    stack.insert(0, "/configure")
                stack.append(line.lstrip())

            elif nxt_indent == indent:
                if line.strip() != "exit":
                    if exit_detected:
                        stack.append(line.strip())
                    else:
                        if len(stack) != 0:
                            new_conf = new_conf + "\n" + output(stack)
                            pop(stack)
                            stack.append(line.strip())
                        else:
                            stack.insert(0, "/configure")
                            stack.append(line.strip())
                    exit_detected = False

            else:
                if line.strip() == "exit":
                    if not exit_detected:
                        new_conf = new_conf + "\n" + output(stack)
                        del stack[-2:]
                    else:
                        pop(stack)
                    exit_detected = True

                else:
                    new_conf = new_conf + "\n" + output(stack)
                    exit_detected = False
                    pop(stack)
            indent = nxt_indent
    
    return new_conf

def main():
    filename = sys.argv[1]
    with open(filename, 'r') as f:
        data = f.read()

    sros_flatten(data)

if __name__ == "__main__":
    main()

huawei ağ ekipmanlarında basit ospf uygulaması

ospf detaylarına girmeden huawei ağ ekipmanlarında ospf nasıl kullanabiliriz ve kontrol edebiliriz aşağıdaki örnek topolojide incelemeye çalışalım.

yönlendiriciler üzerine öncelikle arayüz iplerini girelim

sysname R1

router id 192.168.0.1

interface Ethernet0/0/1
 ip address 192.168.100.1 255.255.255.0

interface GigabitEthernet0/0/0
 ip address 192.168.1.1 255.255.255.252

interface LoopBack0
 ip address 192.168.0.1 255.255.255.255
sysname R2

router id 192.168.0.2

interface Ethernet0/0/1
 ip address 192.168.101.1 255.255.255.0

interface GigabitEthernet0/0/0
 ip address 192.168.1.2 255.255.255.252

interface LoopBack0
 ip address 192.168.0.2 255.255.255.255

arayüzlerin durumunu kontrol edelim

<R1>display ip interface brief 
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 8
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 8

Interface                         IP Address/Mask      Physical   Protocol  
Ethernet0/0/0                     unassigned           down       down      
Ethernet0/0/1                     192.168.100.1/24     up         up        
GigabitEthernet0/0/0              192.168.1.1/30       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
GigabitEthernet0/0/3              unassigned           down       down      
LoopBack0                         192.168.0.1/32       up         up(s)     
NULL0                             unassigned           up         up(s)     
Serial0/0/0                       unassigned           down       down      
Serial0/0/1                       unassigned           down       down      
Serial0/0/2                       unassigned           down       down      
Serial0/0/3                       unassigned           down       down 

tüm arayüzlerimiz aktif durumda. yönlendirme tablolarını da kontrol edelim

<R1>display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
    192.168.1.0/30  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
  192.168.100.0/24  Direct  0    0           D   192.168.100.1   Ethernet0/0/1
  192.168.100.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/1

R1 üzerinde görüleceği üzere pc1 den pc2 ye ulaşmak istersek R1 üzerinden gerekli yönlendirme yapılamayacaktır. bu yönlendirme işlemini ospf ile yapmaya çalışalım..

R1 üzerine area 0 oluşturalım ve cihaz üzerindeki tüm networkleri ekleyelim

[R1]ospf 1 router-id 192.168.0.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.100.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.3
[R1-ospf-1-area-0.0.0.0]network 192.168.0.1 0.0.0.0

r1 üzerinde ospf için gerekli ayarları yaptıktan sonra gerekli kontrolleri sağlayalım.

[R1]display  ospf lsdb 

	 OSPF Process 1 with Router ID 192.168.0.1
		 Link State Database 

		         Area: 0.0.0.0
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    192.168.0.1     192.168.0.1        440  60    80000005       1
<R1>display ospf nexthop 

	 OSPF Process 1 with Router ID 192.168.0.1
		 Routing Nexthop information 

  Next hops: 
  Address         Type       Refcount  IntfAddr        Intf Name 
 ----------------------------------------------------------------
  192.168.100.1   Local      1         192.168.100.1   Ethernet0/0/1 
  192.168.1.1     Local      1         192.168.1.1     GigabitEthernet0/0/0 
  192.168.0.1     Local      1         192.168.0.1     LoopBack0 
<R1>display ospf routing 

	 OSPF Process 1 with Router ID 192.168.0.1
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 192.168.0.1/32     0     Stub       192.168.0.1     192.168.0.1     0.0.0.0
 192.168.1.0/30     1     Stub       192.168.1.1     192.168.0.1     0.0.0.0
 192.168.100.0/24   1     Stub       192.168.100.1   192.168.0.1     0.0.0.0

 Total Nets: 3  
 Intra Area: 3  Inter Area: 0  ASE: 0  NSSA: 0 
[R1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
    192.168.1.0/30  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
  192.168.100.0/24  Direct  0    0           D   192.168.100.1   Ethernet0/0/1
  192.168.100.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/1

şimdi R2 üzefinde ospf konfigürasyonu yapmaya başlayalım. ilk önce area 0 oluşturalım ve R1 arayünün ip networke ekleyelim ve değişimleri gözlemleyelim

<R1>display ospf lsdb

	 OSPF Process 1 with Router ID 192.168.0.1
		 Link State Database 

		         Area: 0.0.0.0
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    192.168.0.2     192.168.0.2         35  36    80000003       1
 Router    192.168.0.1     192.168.0.1         31  60    80000009       1
 Network   192.168.1.1     192.168.0.1         31  32    80000002       0
<R1>display ospf routing

	 OSPF Process 1 with Router ID 192.168.0.1
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 192.168.0.1/32     0     Stub       192.168.0.1     192.168.0.1     0.0.0.0
 192.168.1.0/30     1     Transit    192.168.1.1     192.168.0.1     0.0.0.0
 192.168.100.0/24   1     Stub       192.168.100.1   192.168.0.1     0.0.0.0

 Total Nets: 3  
 Intra Area: 3  Inter Area: 0  ASE: 0  NSSA: 0 
<R1>display ospf nexthop 

	 OSPF Process 1 with Router ID 192.168.0.1
		 Routing Nexthop information 

  Next hops: 
  Address         Type       Refcount  IntfAddr        Intf Name 
 ----------------------------------------------------------------
  192.168.100.1   Local      1         192.168.100.1   Ethernet0/0/1 
  192.168.1.1     Local      1         192.168.1.1     GigabitEthernet0/0/0 
  192.168.0.1     Local      1         192.168.0.1     LoopBack0 
<R1>display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
    192.168.1.0/30  Direct  0    0           D   192.168.1.1     GigabitEthernet0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
  192.168.100.0/24  Direct  0    0           D   192.168.100.1   Ethernet0/0/1
  192.168.100.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/1

R2 için diğer networkleride ekleyelim. yönlendirme tabloları , lsdb vb deki değişimleri gözlemleyelim.

ospf 1 router-id 192.168.0.2
 area 0.0.0.0
  network 192.168.1.0 0.0.0.3
  network 192.168.0.2 0.0.0.0
  network 192.168.101.0 0.0.0.255

tüm networkleri r2 üzerinde tamamladıktan sonra yönlendirme tablosunu kontrol ederek pc1 den pc2 ye erişimi kontrol edelim.

<R1>display ospf routing 

	 OSPF Process 1 with Router ID 192.168.0.1
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 192.168.0.1/32     0     Stub       192.168.0.1     192.168.0.1     0.0.0.0
 192.168.1.0/30     1     Transit    192.168.1.1     192.168.0.1     0.0.0.0
 192.168.100.0/24   1     Stub       192.168.100.1   192.168.0.1     0.0.0.0
 192.168.0.2/32     1     Stub       192.168.1.2     192.168.0.2     0.0.0.0
 192.168.101.0/24   2     Stub       192.168.1.2     192.168.0.2     0.0.0.0

 Total Nets: 5  
 Intra Area: 5  Inter Area: 0  ASE: 0  NSSA: 0
PC>ping 192.168.101.1

Ping 192.168.101.1: 32 data bytes, Press Ctrl_C to break
From 192.168.101.1: bytes=32 seq=1 ttl=254 time=62 ms
From 192.168.101.1: bytes=32 seq=2 ttl=254 time=94 ms
From 192.168.101.1: bytes=32 seq=3 ttl=254 time=78 ms
From 192.168.101.1: bytes=32 seq=4 ttl=254 time=78 ms
From 192.168.101.1: bytes=32 seq=5 ttl=254 time=47 ms

--- 192.168.101.1 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/71/94 ms

huawei network ekipmanlarında mevcut yapılandırmaları sıfırlamak

bazı zamanlarda yapılandırmayı sıfırdan yapmak bir zorunluluk veya tercih olacaktır. bu gibi durumlarda huawei ekipmanları üzerindeki mevcut yapılandırmalardan kurtulmanın en kolay yöntemi bir çok network ekipmanında olduğu gibi açılış sırasında işletilen yapılandırma dosyasını / ayarlarını yok etmek ve ekipmanı yeniden başlatmaktır.

huawei de bu yapmak için konfig moda girmeden “reset saved-configuration” ile konfigürasyon dosyasını silerek sürece başlıyoruz.

<r6>reset saved-configuration 
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:Y
Warning: Now clearing the configuration in the device.
Apr 30 2019 23:57:46-08:00 r6 %%01CFM/4/RST_CFG(l)[2]:The user chose Y when deci
ding whether to reset the saved configuration.
Info: Succeeded in clearing the configuration in the device.

sonrasında ise network ekipmanımızı reboot ediyoruz… promttan görüleceği üzere örneğimizde router konfigürasyonu sıfırlanmış oldu.

<r6>reboot
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:N
Info: If want to reboot with saving diagnostic information, input 'N' and then e
xecute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:Y
Apr 30 2019 23:57:57-08:00 r6 %%01CMD/4/REBOOT(l)[3]:The user chose Y when decid
ing whether to reboot the system. (Task=co0, Ip=**, User=**)
<r6>####################
<Huawei>

huawei network ekipmanlarında dhcp

bir önceki https://ferhatcicek.com/2019/04/28/huawei-network-ekipmanlarinda-en-basitinden-dhcp/yazıda huawei network ekipmanlarından en basit dhcp ayarlarının nasıl yapılacağı anlatılmıştı. şimdi işi biraz daha kurallarına uygun şekilde yapalım.

topolojimizde bir değişiklik yapmıyoruz. bu örneğimizde iki farklı ip havuzu oluşturacağız ve portlar da atadığımız vlana göre ip dağıtımı yapacağız. dhcp yi globalde aktif ettikten sonra ip havuzlarımızı oluşturalım.

dhcp enable

ip pool pool1
 gateway-list 192.0.1.1
 network 192.0.1.0 mask 255.255.255.0
 lease day 10 hour 0 minute 0
 dns-list 8.8.8.8

ip pool pool2
 gateway-list 192.0.2.1
 network 192.0.2.0 mask 255.255.255.0
 lease day 6 hour 0 minute 0
 dns-list 8.8.8.8

sonrasında kullanacağımız vlanları oluşturarak dhcp ile ilişkilendirmesini yapalım

vlan batch 10 to 11

interface Vlanif10
 ip address 192.0.1.1 255.255.255.0
 dhcp select global

interface Vlanif11
 ip address 192.0.2.1 255.255.255.0
 dhcp select global

kulanacağımız portları aktif ederek uygun vlan atamasını yapalım.

interface GigabitEthernet0/0/1
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10

interface GigabitEthernet0/0/2
 port hybrid pvid vlan 11
 port hybrid untagged vlan 11

sıra geldik kontrolleri yapmaya

display ip pool name pool1 
  Pool-name      : pool1
  Pool-No        : 0
  Lease          : 10 Days 0 Hours 0 Minutes
  Domain-name    : -
  DNS-server0    : 8.8.8.8         
  NBNS-server0   : -               
  Netbios-type   : -               
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.0.1.1       
  Mask           : 255.255.255.0
  VPN instance   : --
 ------------------------------------------------------
         Start           End     Total  Used  Idle(Expired)  Conflict  Disable
 ------------------------------------------------------
       192.0.1.1     192.0.1.254   253     1        252(0)         0        0
 ------------------------------------------------------

huawei network ekipmanlarında en basitinden dhcp

huawei network ekipmanlarda dhcp kullanmanın en basit yöntemi dhcp yi globalda aktif etmek ve vlanif1 altına gerekli dhcp ayarlarının yapılmasıdır.

dhcp enable

interface Vlanif1
 ip address 192.168.0.1 255.255.255.0
 dhcp select interface
 dhcp server dns-list 195.175.39.39

ensp üzerinde yukarıdaki topolojiyi oluşturup gerekli yapılandırmayı yaparsanız

PC>ipconfig /renew

IP Configuration

Link local IPv6 address...........: fe80::5689:98ff:fe41:30a4
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.0.249
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.0.1
Physical address..................: 54-89-98-41-30-A4
DNS server........................: 195.175.39.39

pclerin dhcp üzerinden ip aldığını göreceksiniz. küçük bir ağ için işinize yaracaktır.

huawei network ekipmanlarında “port bazlı vlan” örneği

ağları birbirinden yalıtmanın en kolay yöntemi vlan bazlı bir yapı oluşturmaktır. huawei switchlerde port bazlı vlan yapılandırma örneğini ensp üzerinde yapalım.

A ve B binasında farklı birimlere ait bilgisayarlarımız olduğunu ve aynı birim tarafından kullanılan pclerin sadece kendileri ile haberleşeceği bir yapı oluşturalım.

iki birim için

Y : 192.168.100.0/24
Z : 192.168.200.0/24

şeklinde subnet belirleyelim. yukarıdaki ağ yapısında pc1 ile pc3 ün pc2 ile pc4 ün birbiri ile haberleşmesi için izlenecek adımlar temel olarak

  • belirlenen subnetlere uygun olarak pc ağ yapılandırması yapılmalı. ve subnetler için bir vlan belirlenerek switchler üzerinde bu vlanlar aktif edilmeli
  • pc lerin çalışacağı portlara uygun vlanlar atanmalı
  • iki switch arasındaki link aktif edilerek tüm vlanları geçirecek şekilde yapılandırmalı

ağ yapısını ensp üzerinde oluşturduktan sonra pcleri ensp de yapılandıralım.


sıre switchler üzerinde vlanları aktif etmeye geldi

vlan batch 100 200

pclerin bağlı olduğu portları access / tagsiz olarak ayarlayarak uygun vlanları girelim

interface GigabitEthernet0/0/1
  port link-type access
  port default vlan 100
 
 interface GigabitEthernet0/0/2
  port link-type access
  port default vlan 200

her iki switch arasındaki bağlantının olduğu portları trunk olarak ayarlayalım ve 100, 200 vlanlarının geçişlerine izin verelim.

interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 100 200

artık ağ yapımız aktif oldu. sıra kontrole geldi.

<switch_a>display mac-address 
<switch_a>

pcler üzerinde bir trafik başlatmadığımız için görüldüğü üzere switch üzerinde mac adresi göremiyoruz. şimdi pc1 den pc3 e ping atalım.

PC>ping 192.168.100.2

Ping 192.168.100.2: 32 data bytes, Press Ctrl_C to break
From 192.168.100.2: bytes=32 seq=1 ttl=128 time=93 ms
From 192.168.100.2: bytes=32 seq=2 ttl=128 time=125 ms

yapılandırmamız sorunsuz şekilde çalıştı ve pc1 den pc3 e ping atabildik. switch_a üzerinde mac adreslerini inceleyelim

<switch_a>display mac-address
MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
               VSI/SI                                              MAC-Tunnel  
-------------------------------------------------------------------------------
5489-9890-6bfa 100         -      -      GE0/0/1         dynamic   0/-         
5489-987f-4c7f 100         -      -      GE0/0/3         dynamic   0/-         
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 2 

<switch_a>

pc1in bağlı olduğu 0/0/1 portunda ve link olarak kullandığımız 0/0/3 portunda 100 vlanı için pc1 ve pc3 mac adreslerini görüyoruz. şimdi de pc2 den pc4 e ping atalım ve 200 vlanı için konfigürasyonu test edelim.

PC>ping 192.168.200.2

Ping 192.168.200.2: 32 data bytes, Press Ctrl_C to break
 From 192.168.200.2: bytes=32 seq=1 ttl=128 time=78 ms
 From 192.168.200.2: bytes=32 seq=2 ttl=128 time=79 ms

testimiz başarılı şekilde gerçekleşti. switch_a üzerinden tekrardan mac – vlan kontrolü yaptığımızda

<switch_a>display mac-address
MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
               VSI/SI                                              MAC-Tunnel  
-------------------------------------------------------------------------------
5489-9890-6bfa 100         -      -      GE0/0/1         dynamic   0/-         
5489-9843-7a0c 200         -      -      GE0/0/2         dynamic   0/-         
5489-987f-4c7f 100         -      -      GE0/0/3         dynamic   0/-         
5489-98c1-683c 200         -      -      GE0/0/3         dynamic   0/-         
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 4 

0/0/1 , 0/0/2 portunda pc1 ve pc2 nin 0/0/3 portunda ise pc3 ve pc4 ün mac adreslerini görüyoruz. bu durum her şeyin yolunda olduğunun göstergelerinden bir tanesidir.

switch a ve b nin konfigürasyonu aşağıdaki gibidir.

#
sysname switch_a
#
vlan batch 100 200
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 100
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 200
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 100 200
#
sysname switch_b
#
vlan batch 100 200
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 100
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 200
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 100 200

şimdide vlan bazlı kontrolleri nasıl yapacağımız bakalım. display vlan ile tüm vlanları görebiliriz.

[switch_a]display vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/3(U)      GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      
                GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     
                GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     
                GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     
                GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     
                GE0/0/23(D)     GE0/0/24(D)                                     

100  common  UT:GE0/0/1(U)                                                      

             TG:GE0/0/3(U)                                                      

200  common  UT:GE0/0/2(U)                                                      

             TG:GE0/0/3(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
100  enable  default       enable  disable    VLAN 0100                         
200  enable  default       enable  disable    VLAN 0200 

belirli vlan için sorgulama yaparsak

[switch_a]display vlan 100 
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
100  common  UT:GE0/0/1(U)                                                      
             TG:GE0/0/3(U)                                                      

VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
100  enable  default       enable  disable    VLAN 0100  

mac adress sayısı çok fazla ve belirli bir vlan için bakmak istiyorsak

[switch_a]display mac-address vlan 100
MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
               VSI/SI                                              MAC-Tunnel  
-------------------------------------------------------------------------------
5489-9890-6bfa 100         -      -      GE0/0/1         dynamic   0/-         
5489-987f-4c7f 100         -      -      GE0/0/3         dynamic   0/-         
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 2 

kullanabiliriz.

ensp için topoloji dosyasını linkten indirebilirsiniz./wp-content/uploads/2019/04/port-based-vlan.zip

Huawei – Default Account / Password Query Tool

on yıl önce huawei yönlendiriler için fabrika çıkışı kullanıcı adı şifresini
huawei yönlendiricilerin fabrika çıkış şifresi adresinde yayınlamışım. o zamanlar bu bilgi her yerde yer almıyordu. o tarihten bu güne kadar huawei o kadar fazla ağ ekipmanı ve bu ekipmanlar için yazılım ürettiki hangisine ne kullanıcı adı şifresi verdiklerini kendileri de karıştırmaya başladı sanırım 🙂

sırf bu amaçla bir süre önce http://support.huawei.com/onlinetoolsweb/pqt/indexEn.jsp?domain=1 adresi altında online bir hizmeti kullanıcılara sunmaya başladı. herhangi bir huawei ağ ekipmanın fabrika ayarlarına ait kullanıcı adı şifresi lazım olursa “Default Account/Password Query Tool” aracını kullanmanızı öneririm…

huawei switchlerde port altındaki vlanlar

<fcicek_test>display  port vlan 
Port                        Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
Eth-Trunk1                  trunk        1     4 30-31 37 42 53-55 63-65 80-81 
                                               90-91 99-101 110-112 120-121 
                                               123-125 150 160 170 180 190 200 
                                               210 220 355 1011-1014 1018 4090
Eth-Trunk2                  hybrid       1     -                               
GigabitEthernet0/0/1        hybrid       0     -                               
GigabitEthernet0/0/2        hybrid       0     -                               
GigabitEthernet0/0/3        hybrid       1     6-7 30-37 550 555 753-775 4000
GigabitEthernet0/0/4        hybrid       1     -                               
GigabitEthernet0/0/5        hybrid       1     53-58 111-118
GigabitEthernet0/0/6        hybrid       1     63-68 111-118
GigabitEthernet0/0/7        hybrid       1     4 70-71 550 555 757 4093
GigabitEthernet0/0/8        hybrid       1     80-82 1011-1012 1018
GigabitEthernet0/0/9        hybrid       1     90-91 1011-1012 1018
GigabitEthernet0/0/10       hybrid       1     4-7 100-109 111-114 118 550 555 
                                               760-775 1011-1014 1018 4090 4093
GigabitEthernet0/0/11       hybrid       1     4 6 42 110-112 1011-1012 1018 
                                               4090
GigabitEthernet0/0/12       hybrid       1     4-7 120-129 550 555 760-775 4093
GigabitEthernet0/0/13       hybrid       1     -                               
GigabitEthernet0/0/14       hybrid       1     -                               
GigabitEthernet0/0/15       trunk        1     1 150
GigabitEthernet0/0/16       trunk        1     160
GigabitEthernet0/0/17       trunk        1     170
GigabitEthernet0/0/18       trunk        1     180
GigabitEthernet0/0/19       trunk        1     190
GigabitEthernet0/0/20       trunk        1     200
GigabitEthernet0/0/21       trunk        1     210
GigabitEthernet0/0/22       trunk        1     220
GigabitEthernet0/0/23       trunk        1     355
GigabitEthernet0/0/24       hybrid       1     -                               
XGigabitEthernet0/1/1       hybrid       1     -                               
XGigabitEthernet0/1/2       hybrid       1     -  

raspberry pi – statik ip ayarları

raspberry pi nizi statik ip kullanan bir ağa dahil etme durumunuzda /etc/network/interfaces dosyasında ufak bir değişiklik yapmanız gerekecektir.

pi@raspberrypi:~ $ sudo nano  /etc/network/interfaces

dosyamızı açalım. eth0 arayüzü varsayılan olarak dhcp üzerinden ip olacak şekilde yapılandırılmış durumdadır. öncelikle bu satırın başına # ekleyerek pasif hale getirelim.

auto eth0
#iface eth0 inet dhcp

sonrasında kullanacağımız ağa ait gerekli bilgileri girelim. bu örnekte 192.168.5.208/28 ağında 192.168.5.212 ipsini kullanacak şekilde yapılandırma yapıyoruz

iface eth0 inet static
        address 192.168.5.212
        netmask 255.255.255.240
        gateway 192.168.5.209
        network 192.168.5.208
        broadcast 192.168.5.223

dosyayı interfaces dosyasını kaydedip çıkıyoruz. değişikliğin geçerli olması için network ile ilgili servisleri yeniden başlatılması gerekir ancak biz daha sağlam bir yol izliyoruz ve raspberry pi yi yeniden başlatıyoruz

pi@raspberrypi:~ $ sudo reboot

raspberry yeniden başladıktan sonra gerekli kontrollerimizi yapalım

pi@raspberrypi:~ $ ifconfig eth0	
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.5.212  netmask 255.255.255.240  broadcast 192.168.5.223
        inet6 fe80::ba27:ebff:fe40:752b  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:40:75:2b  txqueuelen 1000  (Ethernet)
        RX packets 7839  bytes 3539827 (3.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5185  bytes 1208823 (1.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Back To Top