<?xml version="1.0" encoding="ISO-8859-1" ?>

<NetML xmlns="http://www.xmlnetwork.org"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.xmlnetwork.org
                                          netml.xsd">

   <AS-List>
      <AS number="AS100" >
         <InternalNetworks>
            <n id="n-J"/>
         </InternalNetworks>
         <BorderRouters>
            <r id="r_100_1"/>
         </BorderRouters>
      </AS>
      <AS number="AS20" >
         <InternalNetworks>
            <n id="n-C"/>
         </InternalNetworks>
         <BorderRouters>
            <r id="r_20_1"/>
            <r id="r_20_2"/>
         </BorderRouters>
      </AS>
   </AS-List>

   <ebgpPeerings>
      <P id="p01">
         <PeeringSide>
            <as>AS100</as>
            <router>r_100_1</router>
            <iface>eth0</iface>
         </PeeringSide>
         <PeeringSide>
            <as>AS20</as>
            <router>r_20_2</router>
            <iface>eth0</iface>
         </PeeringSide>
      </P>
      <P id="p02">
         <PeeringSide>
            <as>AS100</as>
            <router>r_100_1</router>
            <iface>eth1</iface>
         </PeeringSide>
         <PeeringSide>
            <as>AS20</as>
            <router>r_20_1</router>
            <iface>eth1</iface>
         </PeeringSide>
      </P>
   </ebgpPeerings>

   <Networks>
      <n id="n-C">
         <networkAddress>20.1.1.0/24</networkAddress>
         <CollisionDomains>
            <c id="C">
               <iface r_id="r_20_1" if="eth0"/>
               <iface r_id="r_20_2" if="eth1"/>
            </c>
         </CollisionDomains>
      </n>
      <n id="n-E">
         <networkAddress>11.0.0.0/30</networkAddress>
         <CollisionDomains>
            <c id="E">
               <iface r_id="r_20_2" if="eth0"/>
               <iface r_id="r_100_1" if="eth0"/>
            </c>
         </CollisionDomains>
      </n>
      <n id="n-F">
         <networkAddress>11.0.0.4/30</networkAddress>
         <CollisionDomains>
            <c id="F">
               <iface r_id="r_100_1" if="eth1"/>
               <iface r_id="r_20_1" if="eth1"/>
            </c>
         </CollisionDomains>
      </n>
      <n id="n-J">
         <networkAddress>100.1.0.0/16</networkAddress>
         <CollisionDomains>
            <c id="J">
               <iface r_id="r_100_1" if="eth2"/>
            </c>
         </CollisionDomains>
      </n>
   </Networks>

   <Routers>
      <RouterConf id="r_20_1" Hostname="as20r1">
         <Interface name="eth0">
            <ipAddress>20.1.1.1/24</ipAddress>
         </Interface>
         <Interface name="eth1">
            <ipAddress>11.0.0.6/30</ipAddress>
         </Interface>

         <Policy name="RedistConnected">
            <Redistribution>
               <from_protocol>connected</from_protocol>
               <to_protocol>bgp</to_protocol>
            </Redistribution>
        </Policy>
<!--        <List>
            <id>defaultOut</id>
            <RouteList>
               <routeFilter>
                  <prefix>0.0.0.0/16</prefix>
                  <matchType>
                     <Exact/>
                  </matchType>
                  <target>permit</target>
               </routeFilter>
            </RouteList>
         </List>
         <List>
            <id>as100in</id>
            <RouteList>
               <routeFilter>
                  <prefix>100.1.0.0/16</prefix>
                  <matchType>
                     <Exact/>
                  </matchType>
                  <target>permit</target>
               </routeFilter>
            </RouteList>
         </List>  -->

         <BGPConf as="20">
            <StaticRoutes>
               <!-- <s address="20.1.1.0/24"/> -->
               <s address="0.0.0.0/0"/>
            </StaticRoutes>
            <Policy type="export">RedistConnected</Policy>
            <PeerGroup name="EBGP">
               <Neighbor address="11.0.0.5">
                  <Description>Router as100r1</Description>
                  <Peer-AS name="100"/>
                  <!-- <List type="Prefix" inOut="export">defaultOut</List>
                  <List type="Prefix" inOut="import">as100in</List> -->
               </Neighbor>
            </PeerGroup>
            <PeerGroup name="IBGP">
               <Neighbor address="20.1.1.2">
                  <Description>Router as100r2</Description>
                  <Peer-AS name="20"/>
               </Neighbor>
            </PeerGroup>
         </BGPConf>
      </RouterConf>

      <RouterConf id="r_20_2" Hostname="as20r2">
         <Interface name="eth0">
            <ipAddress>11.0.0.2/30</ipAddress>
         </Interface>
         <Interface name="eth1">
            <ipAddress>20.1.1.2/24</ipAddress>
         </Interface>
         <Policy name="RedistConnected">
            <Redistribution>
               <from_protocol>connected</from_protocol>
               <to_protocol>bgp</to_protocol>
            </Redistribution>
         </Policy>
         <!-- <List>
            <id>as100In</id>
            <RouteList>
               <routeFilter>
                  <prefix>100.1.0.0/16</prefix>
                  <matchType>
                     <Exact/>
                  </matchType>
                  <target>permit</target>
               </routeFilter>
            </RouteList>
         </List>
         <List>
            <id>defaultOut</id>
            <RouteList>
               <routeFilter>
                  <prefix>0.0.0.0/16</prefix>
                  <matchType>
                     <Exact/>
                  </matchType>
                  <target>permit</target>
               </routeFilter>
            </RouteList>
         </List>
         -->
         <BGPConf as="20">
            <StaticRoutes>
               <!-- <s address="20.1.1.0/24"/> -->
               <s address="0.0.0.0/0"/>
            </StaticRoutes>
            <Policy type="export">RedistConnected</Policy>
            <PeerGroup name="EBGP">
               <Neighbor address="11.0.0.1">
                  <Description>Router as100r1</Description>
                  <Default-Originate/>
                  <Peer-AS name="100"/>
                  <!-- <List type="Prefix" inOut="export">defaultOut</List>
                  <List type="Prefix" inOut="import">as100In</List> -->
               </Neighbor>
            </PeerGroup>
           <PeerGroup name="IBGP">
               <Neighbor address="20.1.1.1">
                  <Description>Router as100r2</Description>
                  <Peer-AS name="20"/>
               </Neighbor>
            </PeerGroup>
         </BGPConf>
      </RouterConf>

      <RouterConf id="r_100_1" Hostname="as100r1">
         <Interface name="eth0">
            <ipAddress>11.0.0.1/30</ipAddress>
         </Interface>
         <Interface name="eth1">
            <ipAddress>11.0.0.5/30</ipAddress>
         </Interface>
         <Interface name="eth2">
            <ipAddress>100.1.0.1/16</ipAddress>
         </Interface>
         <Policy name="RedistConnected">
            <Redistribution>
               <from_protocol>connected</from_protocol>
               <to_protocol>bgp</to_protocol>
            </Redistribution>
         </Policy>
         <!-- <Policy name="metricOut">
            <General>
               <term priority="10">
                  <matchConditions>
                     <List match="IP_address">myAggregate</List>
                  </matchConditions>
                  <setRules>
                     <characteristics operation="none">
                        <type>metric</type>
                        <value>10</value>
                     </characteristics>
                  </setRules>
               </term>
            </General>
         </Policy>
         <Policy name="localPrefIn">
            <General>
               <term priority="10">
                  <setRules>
                     <characteristics operation="none">
                        <type>local preference</type>
                        <value>90</value>
                     </characteristics>
                  </setRules>
               </term>
            </General>
         </Policy>
         <List>
            <id>mineOutOnly</id>
            <RouteList>
               <routeFilter>
                  <prefix>100.1.0.0/16</prefix>
                  <matchType>
                     <Exact/>
                  </matchType>
                  <target>permit</target>
               </routeFilter>
            </RouteList>
         </List>
         <List>
            <id>defaultIn</id>
            <RouteList>
               <routeFilter>
                  <prefix>0.0.0.0/0</prefix>
                  <matchType>
                     <Exact/>
                  </matchType>
                  <target>permit</target>
               </routeFilter>
            </RouteList>
         </List>
         <List>
            <id>myAggregate</id>
            <PrefixList>
               <prefix>100.1.0.0/16</prefix>
            </PrefixList>
         </List>
         -->
         <BGPConf as="100">
            <StaticRoutes>
               <s address="100.1.0.0/16"/>
            </StaticRoutes>            
            <Policy type="export">RedistConnected</Policy>
            <PeerGroup name="EBGP">
               <Neighbor address="11.0.0.2">
                  <Description>Router as20r2 (primary)</Description>
                  <Peer-AS name="20"/>
                  <!--<List type="Prefix" inOut="export">mineOutOnly</List>
                  <List type="Prefix" inOut="import">defaultIn</List> -->
               </Neighbor>
               <Neighbor address="11.0.0.6">
                  <Description>Router as20r1 (backup)</Description>
                  <Peer-AS name="20"/>
                  <!-- <Policy type="export">metricOut</Policy>
                  <Policy type="import">localPrefIn</Policy>
                  <List type="Prefix" inOut="export">mineOutOnly</List>
                  <List type="Prefix" inOut="import">defaultIn</List> -->
               </Neighbor>
            </PeerGroup>
         </BGPConf>
      </RouterConf>

   </Routers>
</NetML>



