Step 9. Using Network attribute to advertise specific networks¶
Goals¶
This example shows how to advertise selective networks in BGP using the ‘Network’ attribute.
[explanation]
Configuration¶
This step uses the same network as the previous one.
The configuration in omnetpp.ini
is the following:
[Config Step9]
description = "Using Network attribute to advertise specific networks"
network = BGP_Topology_4
# this example shows how to advertise selective networks in BGP using the 'Network' attribute
*.configurator.config = xml("<config> \
<interface hosts='RA4' names='eth0' address='192.168.x.x' netmask='255.x.x.x'/> \
<interface hosts='RB1' names='eth2' address='192.168.x.x' netmask='255.x.x.x'/> \
<interface hosts='RB4' names='eth2' address='192.168.x.x' netmask='255.x.x.x'/> \
<interface hosts='RC1' names='eth2' address='192.168.x.x' netmask='255.x.x.x'/> \
\
<interface among='host0 RA*' address='10.x.x.x' netmask='255.x.x.x'/> \
<interface hosts='RA*' address='10.x.x.x' netmask='255.x.x.x'/> \
\
<interface hosts='RB*' address='20.x.x.x' netmask='255.x.x.x'/> \
\
<interface among='host1 RC*' address='30.x.x.x' netmask='255.x.x.x'/> \
<interface hosts='RC*' address='30.x.x.x' netmask='255.x.x.x'/> \
\
<route hosts='host*' destination='*' netmask='0.0.0.0' interface='eth0' /> \
</config>")
# OSPF configuration
*.R*.hasOspf = true
*.R*.ospf.ospfConfig = xmldoc("OSPFConfig.xml")
# BGP configuration
*.RA4.hasBgp = true
*.RB1.hasBgp = true
*.RB4.hasBgp = true
*.RC1.hasBgp = true
*.R*.bgp.bgpConfig = xmldoc("BGPConfig.xml")
The BGP configuration:
<?xml version="1.0" encoding="ISO-8859-1"?>
<BGPConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="BGP.xsd">
<TimerParams>
<connectRetryTime> 120 </connectRetryTime>
<holdTime> 180 </holdTime>
<keepAliveTime> 60 </keepAliveTime>
<startDelay> 50 </startDelay> <!--long enough for the intra-AS routing protocol to converge-->
</TimerParams>
<AS id="64500">
<!--router RA4-->
<Router interAddr="10.0.0.1">
<Network address='10.0.0.0' />
<Network address='10.0.0.4' />
</Router>
</AS>
<AS id="64600">
<!--router RB1-->
<Router interAddr="20.0.0.6">
<Network address='20.0.0.4' />
<Network address='20.0.0.16' />
</Router>
<!--router RB4-->
<Router interAddr="20.0.0.2">
<Network address='20.0.0.0' />
<Network address='20.0.0.12' />
</Router>
</AS>
<AS id="64700">
<!--router RC1-->
<Router interAddr="30.0.0.1">
<Network address='30.0.0.0' />
<Network address='30.0.0.4' />
</Router>
</AS>
<!--bi-directional E-BGP session between RA4 and RB1-->
<Session id="1">
<Router exterAddr="192.168.0.5"/>
<Router exterAddr="192.168.0.6"/>
</Session>
<!--bi-directional E-BGP session between RB4 and RC1-->
<Session id="2">
<Router exterAddr="192.168.0.1"/>
<Router exterAddr="192.168.0.2"/>
</Session>
</BGPConfig>