[Xorp-users] What exactly wrong in policy-statement bgp_out / bgp_in? This settings work fine with OSPF . . . Fw: XORP on Windows 8 -- OSPF and BGP

Victor Miasnikov vvm at tut.by
Mon Mar 19 09:20:02 PDT 2012


Hi!


 After some changes ( see .diff) I'm see in log:


===
...


[ 2012/3/19 13:56:54.305000  ERROR ..\lib\xorp\sbin\xorp_bgp.exe:4764 BGP bgp/xrl_target.cc:418 
bgp_0_3_change_local_ip ] local ip 10.99.93.77 local port 179 peer ip 10.99.93.123 peer port 179 new_local_ip 
10.99.93.77 new_local_dev:
[ 2012/3/19 13:56:54.306000  ERROR ..\lib\xorp\sbin\xorp_bgp.exe:4764 BGP bgp/xrl_target.cc:418 
bgp_0_3_change_local_ip ] local ip 10.99.93.77 local port 179 peer ip 10.99.93.123 peer port 179 new_local_ip 
10.99.93.77 new_local_dev:
[ 2012/3/19 13:56:54.316000  WARNING ..\lib\xorp\sbin\xorp_policy.exe:3772 XrlPolicyTarget 
obj/i386-pc-mingw32/xrl/targets/policy_base.cc:1601 handle_policy_0_1_import ] Handling method for policy/0.1/import 
failed: XrlCmdError 102 Command failed Import of bgp failed: sem_error from line 278 of policy/visitor_semantic.cc: May 
not define protocol for import policy at line 1
[ 2012/3/19 13:56:54.317000  ERROR xorp_rtrmgr.exe:2256 RTRMGR rtrmgr/master_conf_tree.cc:700 commit_pass2_done ] Commit 
failed: 102 Command failed Import of bgp failed: sem_error from line 278 of policy/visitor_semantic.cc: May not define 
protocol for import policy at line 1
[ 2012/3/19 13:56:54.317000  ERROR xorp_rtrmgr.exe:2256 RTRMGR rtrmgr/master_conf_tree.cc:269 config_done ] 
Configuration failed: 102 Command failed Import of bgp failed: sem_error from line 278 of policy/visitor_semantic.cc: 
May not define protocol for import policy at line 1

...
===


 what exactly wrong in

                term 10 {
                term 20 {
                term 30 {

of


        policy-statement bgp_out
        policy-statement bgp_in


?

This settings work fine with OSPF . . .


 .diff :
==
--- config.boot-Ok-OSPF_and_BGP  Public ##.txt Mon Mar 19 18:51:40 2012
+++ config.boot-With_Errors-OSPF_and_BGP  Public ##.txt Mon Mar 19 18:55:09 2012
@@ -217,7 +217,8 @@
 */
 policy {
  policy-statement bgp_out {
-/*
+/* { */
+
          term 10 {
       from {
           protocol: "connected"
@@ -248,7 +249,7 @@
                  }
              }
          }
-*/
+/* } */
   term 98 {
              from {
               protocol: "static"
@@ -272,7 +273,7 @@

  }
  policy-statement bgp_in {
-/*
+/* { */
          term 10 {
       from {
           protocol: "connected"
@@ -303,7 +304,7 @@
                  }
              }
          }
-*/
+/* } */
   term 99 {
              from {
              }

==


 _Worked_ config:
==
/*XORP Configuration File, v1.0*/
fea {
    unicast-forwarding4 {
        disable: false
/* { * /
        forwarding-entries {
            retain-on-startup: true
            retain-on-shutdown: true
        }
/ * } */
    }
}
interfaces {
    restore-original-config-on-shutdown: true

/*
===========================================================================
Interface List
 16...e0 69 95 98 9c 92 ......ZZZZZZZ ZZZZZZ PCI-E Gigabit Ethernet Controller (NDIS 6.30) - ZZZZZZZ ZZZZZZ
  1...........................Software Loopback Interface 1
 13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
===========================================================================

Iface name: dc0  idx: 16 iftree: system-config oper-status: 1
Iface name: Loopback Pseudo-Interface 1  idx: 1 iftree: system-config oper-status: 1
Iface name: isatap.local.st.by  idx: 13 iftree: system-config oper-status: 2

@VVMComp> show interfaces
Software Loopback Interface 1: Flags:<> mtu 0 speed unknown
        physical index 0
dc0/dc0: Flags:<ENABLED,BROADCAST,MULTICAST> mtu 1500 speed unknown
        inet 10.99.93.77 subnet 10.99.93.0/24 broadcast 10.99.93.255
        physical index 16
        ether e0:69:95:a8:ac:92
isatap.local.st.by/isatap.local.st.by: Flags:<NO-CARRIER> mtu 1280 speed unknown
*/

/*
===========================================================================
Interface List
 16...e0 69 95 98 9c 92 ......ZZZZZZZ ZZZZZZ PCI-E Gigabit Ethernet Controller (NDIS 6.30) - ZZZZZZZ ZZZZZZ
===========================================================================
*/
/*

Iface name: dc0  idx: 16 iftree: system-config oper-status: 1


@VVMComp> show interfaces
dc0/dc0: Flags:<ENABLED,BROADCAST,MULTICAST> mtu 1500 speed unknown
        inet 10.99.93.77 subnet 10.99.93.0/24 broadcast 10.99.93.255
        physical index 16
        ether e0:69:95:98:9c:92

*/

    interface lo0 {
        disable: false
        discard: false
        description: "MS LoopBack Adapter -- Windows 8"
        default-system-config
    }

    interface dc0 {
        description: "dc0 LanCard"
        disable: false
        discard: false
        default-system-config
/*
        unreachable: false
        management: false
        vif dc0 {
            disable: false
                address 10.99.93.77 {
                        prefix-length: 24
                        disable: false
                }
        }
*/
    }
/*
===========================================================================
Interface List
  1...........................Software Loopback Interface 1
===========================================================================
*/
/*

Iface name: Loopback Pseudo-Interface 1  idx: 1 iftree: system-config oper-status: 1

@VVMComp> show interfaces
Software Loopback Interface 1: Flags:<> mtu 0 speed unknown
        physical index 0
*/
    interface "Software Loopback Interface 1" {
        disable: false
        discard: false
        description: "MS TCP Loopback interface -- Windows 8"
        default-system-config
    }

/*
===========================================================================
Interface List
 13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
===========================================================================


Iface name: isatap.local.st.by  idx: 13 iftree: system-config oper-status: 2

==
@VVMComp> show interfaces
isatap.local.st.by/isatap.local.st.by: Flags:<NO-CARRIER> mtu 1280 speed unknown
==

*/
    interface "isatap.local.st.by" {
        disable: false
        discard: false
        description: "Microsoft ISATAP Adapter -- Windows 8"
        default-system-config
    }
}



protocols {
/*
    fib2mrib {
        disable: true
    }
*/
    static {
        disable: false
        route 10.101.23.0/24 {
            next-hop: 10.99.93.254
            metric: 201
        }
        route 10.101.22.0/24 {
            next-hop: 10.99.93.254
            metric: 201
        }
        route 10.101.30.0/24 {
            next-hop: 10.99.93.254
            metric: 201
        }
        route 0.0.0.0/0 {
            next-hop: 10.99.93.254
            metric: 60
        }
    }
/* { */
    ospf4 {
        router-id: 10.99.93.77
        rfc1583-compatibility: false
        ip-router-alert: false
        area 0.0.0.10 {
            area-type: "normal"
            default-lsa {
                disable: false
                metric: 0
            }
            interface dc0 {
                link-type: "broadcast"
                vif dc0 {
                    address 10.99.93.77 {
                        priority: 255
                        hello-interval: 10
                        router-dead-interval: 40
                        interface-cost: 1
                        retransmit-interval: 5
                        transit-delay: 1
                        authentication {
                            simple-password: "pa$$w0rd"
                        }
                        disable: false
                    }
                }
            }
        }
        export: "Route_Export"
    }
/* } */
/* { */
    bgp {
        export: "bgp_out"
        import: "bgp_in"

        bgp-id: 10.99.93.77
        local-as: 65001

        peer 10.99.93.123 {
            local-ip: 10.99.93.77
            as: 65002
            next-hop: 10.99.93.77
        }
    }
/* } */
}
/*
policy {
    policy-statement connected {
        term export {
            from {
                protocol: "connected"
            }
        }
    }
    policy-statement static {
        term export {
            from {
                protocol: "static"
            }
        }
    }
}
*/
policy {
        policy-statement bgp_out {
/*
                term 10 {
                    from {
                        protocol: "connected"
                        network4-list: "Default_Route"
                    }
                    then {
                        reject {
                        }
                    }
                }
                term 20 {
                    from {
                        protocol: "connected"
                        network4-list: "No_Advertise"
                    }
                    then {
                        reject {
                        }
                    }
                }
                term 30 {
                    from {
                        protocol: "connected"
                    prefix-length4 < 32..32
                    }
                    then {
                        accept {
                        }
                    }
                }
*/
                term 98 {
                    from {
                            protocol: "static"
                    }
                    then {
                            accept
                    }
                }
                term 99 {
                    from {
                            protocol: "bgp"
                    }
                    then {
                            accept
                    }
                }
                then {
                    reject {
                    }
                }

        }
        policy-statement bgp_in {
/*
                term 10 {
                    from {
                        protocol: "connected"
                        network4-list: "Default_Route"
                    }
                    then {
                        reject {
                        }
                    }
                }
                term 20 {
                    from {
                        protocol: "connected"
                        network4-list: "No_Advertise"
                    }
                    then {
                        reject {
                        }
                    }
                }
                term 30 {
                    from {
                        protocol: "connected"
                    prefix-length4 < 32..32
                    }
                    then {
                        accept {
                        }
                    }
                }
*/
                term 99 {
                    from {
                    }
                    then {
                            accept
                    }
                }
                then {
                    reject {
                    }
                }
        }

    policy-statement "Route_Export" {
        term 10 {
            from {
                protocol: "connected"
                network4-list: "Default_Route"
            }
            then {
                reject {
                }
            }
        }
        term 20 {
            from {
                protocol: "connected"
                network4-list: "No_Advertise"
            }
            then {
                reject {
                }
            }
        }
        term 30 {
            from {
                protocol: "connected"
                prefix-length4 < 32..32
            }
            then {
                accept {
                }
            }
        }
        then {
            reject {
            }
        }
    }
    network4-list "No_Advertise" {
        network 127.0.0.0/8 {
            modifier: "orlonger"
        }
/*
        network 10.0.0.0/8 {
            modifier: "orlonger"
        }
*/
        network 172.16.0.0/12 {
            modifier: "orlonger"
        }
        network 192.168.0.0/16 {
            modifier: "orlonger"
        }
    }
    network4-list "Default_Route" {
        network 0.0.0.0/0
    }
}
/*
rtrmgr {
    config-directory: ""
    load-file-command: "fetch"
    load-file-command-args: "-o"
    load-ftp-command: "fetch"
    load-ftp-command-args: "-o"
    load-http-command: "fetch"
    load-http-command-args: "-o"
    load-tftp-command: "sh -c 'echo Not implemented 1>&2 && exit 1'"
    load-tftp-command-args: ""
    save-file-command: "sh -c 'echo Not implemented 1>&2 && exit 1'"
    save-file-command-args: ""
    save-ftp-command: "sh -c 'echo Not implemented 1>&2 && exit 1'"
    save-ftp-command-args: ""
    save-http-command: "sh -c 'echo Not implemented 1>&2 && exit 1'"
    save-http-command-args: ""
    save-tftp-command: "sh -c 'echo Not implemented 1>&2 && exit 1'"
    save-tftp-command-args: ""
}
*/
==


Best regards, Victor Miasnikov
Blog:  http://vvm.blog.tut.by/




More information about the Xorp-users mailing list