Table Of Contents
Table Of Contents

Step 10. LOCAL_PREF Attribute

Goals

[explanation]

Configuration

This step uses the following network:

../../../_images/step10.png
network BGP_LOCAL_PREF
{
    @display("bgb=1328.6062,594.495");

    submodules:
        configurator: Ipv4NetworkConfigurator {
            @display("p=93,44");
        }
        visualizer: IntegratedMultiCanvasVisualizer {
            @display("p=243.2025,43.536247");
        }
        RB1: Router {
            @display("p=730.935,58.275");
        }
        RB2: Router {
            @display("p=730.935,362.97");
        }
        RB3: Router {
            @display("p=910.755,199.8");
        }
        RA: Router {
            @display("p=546.12,199.8");
        }
        switch1: EtherSwitch {
            @display("p=366.3,198.135");
        }
        RC: Router {
            @display("p=564.435,512.82");
        }
        switch2: EtherSwitch {
            @display("p=366.3,511.155");
        }
    connections:
        RB1.ethg++ <--> Eth100M <--> RB3.ethg++;
        RB2.ethg++ <--> Eth100M <--> RB3.ethg++;
        RA.ethg++ <--> Eth100M <--> RB1.ethg++;
        RA.ethg++ <--> Eth100M <--> RB2.ethg++;
        RC.ethg++ <--> Eth100M <--> RB2.ethg++;
        switch1.ethg++ <--> Eth100M <--> RA.ethg++;
        RC.ethg++ <--> Eth100M <--> switch2.ethg++;
}

The configuration in omnetpp.ini is the following:

[Config Step10]
description = "LOCAL_PREF Attribute"
network = BGP_LOCAL_PREF

*.configurator.config = xml("<config> \
                                <interface hosts='RA' names='eth0' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RA' names='eth1' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RB1' names='eth1' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RB2' names='eth1' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RB2' names='eth2' address='192.168.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RC' names='eth0' address='192.168.x.x' netmask='255.x.x.x'/> \
                                \
                                <interface hosts='RA' names='eth2' address='10.x.x.x' netmask='255.x.x.x'/> \
                                <interface among='RB*' address='20.x.x.x' netmask='255.x.x.x'/> \
                                <interface hosts='RC' names='eth1' address='30.x.x.x' netmask='255.x.x.x'/> \
                             </config>")

# OSPF configuration
*.RB*.hasOspf = true
*.RB*.ospf.ospfConfig = xmldoc("OSPFConfig_LOCAL_PREF.xml")

*.R*.hasBgp = true
*.R*.bgp.bgpConfig = xmldoc("BGPConfig_LOCAL_PREF.xml")

*.visualizer.routingTableVisualizer[1].displayRoutingTables = false
#*.visualizer.routingTableVisualizer[*].lineShift = 80
*.visualizer.routingTableVisualizer[*].destinationFilter = "*"
*.visualizer.routingTableVisualizer[*].lineColor = "black"

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 RA-->
        <Router interAddr="10.0.0.1">
            <Network address='10.0.0.0' />
        </Router>
    </AS>
    
    <AS id="64600">
    	<!--router RB1-->
        <Router interAddr="20.0.0.1">
            <Neighbor address='20.0.0.5' nextHopSelf='true' />
            <Neighbor address='20.0.0.2' nextHopSelf='true' localPreference='100' />
        </Router>
                        
        <!--router RB2-->
        <Router interAddr="20.0.0.5">
            <Neighbor address='20.0.0.1' nextHopSelf='true' />
            <Neighbor address='20.0.0.2' nextHopSelf='true' localPreference='600' />
        </Router>        
        
        <!--router RB3-->
        <Router interAddr="20.0.0.2"/>
    </AS>

    <AS id="64700">
    	<!--router RC1-->
        <Router interAddr="30.0.0.1"/>
    </AS>

    <!--bi-directional E-BGP session between RA and RB1-->
    <Session id="1">
        <Router exterAddr="192.168.0.2"/>
        <Router exterAddr="192.168.0.1"/>
    </Session>
    
    <!--bi-directional E-BGP session between RA and RB2-->
    <Session id="2">
        <Router exterAddr="192.168.0.6"/>
        <Router exterAddr="192.168.0.5"/>
    </Session>
    
    <!--bi-directional E-BGP session between RC and RB2-->
    <Session id="3">
        <Router exterAddr="192.168.0.10"/>
        <Router exterAddr="192.168.0.9"/>
    </Session>

</BGPConfig>

Discussion

Use this page in the GitHub issue tracker for commenting on this tutorial.