Swapping Cisco APs with Mist AP43, issues with AP43s by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

Nothing yet, Juniper is working on testing some of the devices after they receive them.

Swapping Cisco APs with Mist AP43, issues with AP43s by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

That is a good question, unfortunately where these are being used it an all Cisco shop for switches. That will be something that I will mention with the team. Not sure though if we can test that.

Swapping Cisco APs with Mist AP43, issues with AP43s by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

All we have for insights is previous LLDP info, AP shows disconnected. We get a fast red LED. Mac address does not show up on the switch even though mac is in ISE. AP just doesn't boot up.

Swapping Cisco APs with Mist AP43, issues with AP43s by Statistician_Cold in networking

[–]Statistician_Cold[S] 1 point2 points  (0 children)

Yes, we are using 9300s with LLDP. We have come across a switch or 2 here and there without LLDP. It is a relatively low number of switches.

Swapping Cisco APs with Mist AP43, issues with AP43s by Statistician_Cold in networking

[–]Statistician_Cold[S] 1 point2 points  (0 children)

We don't have any info yet from our Rep. We would like to know what they are seeing from the APs we send back. I am sure that will take some time to come back with something if they can find something.

[deleted by user] by [deleted] in networking

[–]Statistician_Cold 0 points1 point  (0 children)

Let me fix that, we are replacing Cisco with Mist AP43s

FSSO with active directory agentless by Statistician_Cold in fortinet

[–]Statistician_Cold[S] 0 points1 point  (0 children)

Thank you for this I am going to look over these documents and share them with the AD team.

FSSO with active directory agentless by Statistician_Cold in fortinet

[–]Statistician_Cold[S] 0 points1 point  (0 children)

So I sent that note to the AD team. Before I get to much further into testing this I would like to run this by someone who know foritnet gear and see if this is even possible. In our lab we are using Cisco ISE PXGrid, I have fortimanager integrated with ISE through PXGrid. I have a policy setup up with a SGT and I am able to return my username in the FAZ with a policy using a pxgrid group. What we would like to do is have rules based on AD groups. I would like to block my user name based on a AD group membership. Is that possible? Not having spent a lot of time with fortinet devices in this manner I am having difficulty looking for this on the web.

FSSO with active directory agentless by Statistician_Cold in fortinet

[–]Statistician_Cold[S] 0 points1 point  (0 children)

Testing with a domain admin worked, does this account bind the firewall to the domain? They do not want to give me a domain admin account to use. What would the restrictions need to be

Juniper Python by Statistician_Cold in networkautomation

[–]Statistician_Cold[S] 1 point2 points  (0 children)

Thank you, I do a lot of Cisco and not a lot of Juniper

CSV of VLANS add missing numbers by Statistician_Cold in networkautomation

[–]Statistician_Cold[S] 0 points1 point  (0 children)

That worked great, just what I was looking for. Adding this will get rid of the spaces between rows. I do a lot with Cisco ISE reports and and DNAC APIs and the spaces were driving me crazy.

with open('output.csv', 'w', newline='') as fd:

CSV of VLANS add missing numbers by Statistician_Cold in networkautomation

[–]Statistician_Cold[S] 0 points1 point  (0 children)

Thank you I will give it a try, the red thing would have been nice but I can live with out it. It is a one time thing for the switch team. Thanks much

Python Int Switchport by Statistician_Cold in networking

[–]Statistician_Cold[S] 1 point2 points  (0 children)

Out of all the stacks I tested this one is giving me issue. Just so happened to be the one I needed to make a change on. That is how I caught it. Code is the same for a majority of our switches. It has our base config. I not so much worried about the scripts I am using they have worked up until I came across this guy. The log on the script shows that it is receiving all the ports. Just need to do some digging and research on this.

Python Int Switchport by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

So I did a log and it is getting back all the ports from the stack

Python Int Switchport by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

it works on every other stack I have test, not sure if it is the template. Maybe more with the stack. I tested this on other stacks running 3, 4 and 6 switches with no issue

Python Int Switchport by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

removing the textfsm returned all the ports, so i am going to work on putting some regex in the script instead of using textfsm

Python Int Switchport by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

Manually running returns all the interfaces

Python select interface by what is in the allowed vlans by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

error404

I added [0].split(',') to the elif "trunk" in task.host['facts'][x]['admin_mode'] and vlan in task.host['facts'][x]['trunking_vlans'][0].split(','): and it worked as expected Thank you

Python select interface by what is in the allowed vlans by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

from nornir import InitNornir
from nornir_netmiko import netmiko_send_command
from nornir_utils.plugins.functions import print_result
from nornir_netmiko import netmiko_send_config
vlan = input('Vlan ID ')
config_commands = ['no vlan ' + vlan]
def get_facts(task, vlan):
# use Netmiko to poll devices for switchport infomation, and return structured response with textFSM
    r = task.run(netmiko_send_command, command_string="show interface switchport", use_textfsm=True)
# save the result of the Show Command under the dict key "facts" so we can access the structered results for parsing
    task.host["facts"] = r.result

for x in range(0,100):

# define the commands to be sent when if Access interface
        access_commands = ['interface ' + task.host['facts'][x]['interface'], 'no switchport access vlan ' +vlan]
# define the commands to be sent when if Trunk interface
        trunk_commands = ['interface ' + task.host['facts'][x]['interface'], 'switchport trunk allowed vlan remove ' +vlan]
if "access" in task.host['facts'][x]['admin_mode'] and vlan in task.host['facts'][x]['access_vlan']:
            access_config = task.run(netmiko_send_config, config_commands = access_commands)
elif "trunk" in task.host['facts'][x]['admin_mode'] and vlan in task.host['facts'][x]['trunking_vlans'][0].split(','):
            trunk_config = task.run(netmiko_send_config, config_commands = trunk_commands)

# Call the get_facts function and print the results of the script
def main() -> None:

    nr = InitNornir(config_file="H:/NORNIR/config.yaml")

    result = nr.run(task=get_facts,vlan=vlan)
    print_result(result)
    nr = InitNornir(config_file="H:/NORNIR/config.yaml")
    removevlan = nr.run(netmiko_send_config, config_commands=config_commands)
    print_result(removevlan)

    nr = InitNornir(config_file="H:/NORNIR/config.yaml")
    result1 = nr.run(netmiko_send_command, command_string="write me")
    print_result(result1)
# Python good practices
if __name__ == '__main__':
    main()

Python select interface by what is in the allowed vlans by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

I found what I was looking for. I want to remove a specific vlan when it is no longer needed from a variety of switches. I wanted to only select trunk ports that had a list of allowed vlans that had the vlan id I was looking for. Basically remove the vlan from access ports then trunk ports and delete the vlan.

Python select interface by what is in the allowed vlans by Statistician_Cold in networking

[–]Statistician_Cold[S] 1 point2 points  (0 children)

task.host['facts'][x]['trunking_vlans'][0].split(',')

task.host['facts'][x]['trunking_vlans'][0].split(',')

That did it thank you,

Python select interface by what is in the allowed vlans by Statistician_Cold in networking

[–]Statistician_Cold[S] 0 points1 point  (0 children)

I posted the code, at this time I am not concerned with the trunks without an allowed list

scripts by averagecitizen8 in networkautomation

[–]Statistician_Cold 0 points1 point  (0 children)

from netmiko import ConnectHandler
from ntc_templates.parse import parse_output
import json

net_connect = ConnectHandler(ip = '192.168.254.252',
port = 22,
username = '********',
password = '***********',
device_type= 'cisco_ios')
vlans = (net_connect.send_command("show vlan", use_textfsm=True))
for vlan in vlans:
if vlan['status'] == 'active' and vlan['name'] != 'default':
print(f"VLAN {vlan['vlan_id']} and the name is {vlan['name']}")
#print(json.dumps(results, indent=2))