• 【头歌】 标准ACL配置 坏坏


    标准ACL配置(1)

    • 一键部署
      • 在命令行界面将以下脚本复制到新的脚本文件
      • 执行脚本
      • 测试
    #!/bin/bash
    # 修改输出内容
    cat > /home/headless/Desktop/workspace/myshixun/test.txt << EOF
    使用 PC1 ping PC3 ,回答能否 ping 通( 能或不能 ):能
    使用 PC2 ping PC3 ,回答能否 ping 通( 能或不能 ):不能
    使用R1 telnet R2 ,能否连接上( 能或不能 ):能
        "name": "acl",
    --
                    "name": "PC1",
    --
                    "node_type": "vpcs",
    --
                    "name": "PC2",
    --
                    "node_type": "vpcs",
    --
                    "name": "PC3",
    --
                    "node_type": "vpcs",
    --
                    "name": "R1",
    --
                    "node_type": "dynamips",
    --
                    "name": "R2",
    --
                    "node_type": "dynamips",
    EOF
    
    # 修改测试脚本
    cat > /home/headless/Desktop/workspace/myshixun/test.sh << EOF
    cat /home/headless/Desktop/workspace/myshixun/test.txt
    EOF
    

    标准ACL配置(2)

    • 一键部署
      • 在命令行界面将以下脚本复制到新的脚本文件
      • 执行脚本
      • 测试
    #!/bin/bash
    # 修改输出内容
    cat > /home/headless/Desktop/workspace/myshixun/test.txt << EOF
    hostname R1
    interface FastEthernet0/0
     ip address 10.1.1.1 255.255.255.0
    interface FastEthernet0/1
     ip address 20.1.1.1 255.255.255.0
    interface FastEthernet1/0
     ip address 192.168.12.1 255.255.255.0
    router rip
     version 2
     network 10.0.0.0
     network 20.0.0.0
     network 192.168.12.0
     no auto-summary
    hostname R2
    interface FastEthernet0/0
     ip address 192.168.12.2 255.255.255.0
    interface FastEthernet0/1
     ip address 192.168.23.2 255.255.255.0
    router rip
     version 2
     network 192.168.12.0
     network 192.168.23.0
     no auto-summary
    hostname R3
    interface FastEthernet0/0
     ip address 192.168.23.3 255.255.255.0
     ip access-group 112 in
    router rip
     version 2
     network 192.168.23.0
     no auto-summary
    access-list 111 permit tcp host 192.168.23.2 host 192.168.23.3 eq telnet
    access-list 112 deny   icmp host 10.1.1.10 host 192.168.23.3
    access-list 112 permit icmp any host 192.168.23.3
    line vty 0 4
     password 123
     login
    set pcname PC1
    ip 10.1.1.10 10.1.1.1 24
    set pcname PC2
    ip 20.1.1.10 20.1.1.1 24
    EOF
    
    # 修改测试脚本
    cat > /home/headless/Desktop/workspace/myshixun/test.sh << EOF
    cat /home/headless/Desktop/workspace/myshixun/test.txt
    EOF
    

    以上内容均属原创,如有不详或错误,敬请指出。
    
  • 相关阅读:
    shell 的多进程
    shell 按行读取文件的内容
    2>&1的意思
    >/dev/null 2>&1
    js 变量作用域
    Premiere Pro 中的键盘快捷键
    premiere pro 2019 mac 破解
    js 空语句
    js 数组原型
    js 奇偶判断
  • 原文地址:https://www.cnblogs.com/bad5/p/16249937.html
Copyright © 2020-2023  润新知