#log syslog all;
#log "/tmp/ospf.log" all;


# Override router ID
router id 10.98.13.241;

# Turn on global debugging of all protocols


filter import_OSPF {
        if (net ~ [10.7.0.0/24]) then {
            accept;
        }
        if (net ~ [10.98.0.4/30]) then {
            accept;
        }

        if (net ~ [10.3.50.0/24]) then {
            accept;
        }
        if (net ~ [10.3.60.0/24]) then {
            accept;
        }

        reject;
}

filter export_OSPF {
        # redistribute connected
        if (net ~ [10.98.0.0/19{24,32}]) then {
            print "net accept: ", net;
            accept;
        }
        if (net ~ [10.195.0.0/21{24,32}]) then {
            print "net accept: ", net;
            accept;
        }

	reject;
}

# This pseudo-protocol performs synchronization between BIRD's routing
# tables and the kernel. You can run multiple instances of the kernel
# protocol and synchronize different kernel tables with different BIRD tables.
protocol kernel {
        learn;                  # Learn all alien routes from the kernel
#       persist;                # Don't remove routes on bird shutdown
        scan time 20;           # Scan kernel routing table every 20 seconds
#       import none;            # Default is import all
#       export all;             # Default is export none
        import all;
        export all;
}

# This pseudo-protocol watches all interface up/down events.
protocol device {
        scan time 10;           # Scan interfaces every 10 seconds
}

# Static routes (again, there can be multiple instances, so that you
# can disable/enable various groups of static routes on the fly).

protocol static {

}




protocol ospf {
        rfc1583compat yes;
        import filter import_OSPF;
        export filter export_OSPF;

        area 0 {
                interface "tap0" {
                        cost 100;
                        hello 60;
                        retransmit 2;
                        priority 0;
                        wait 5;
                        dead 120;
                        type ptmp;
                        neighbors { 10.9.252.1; };
                        authentication none;
                };

                interface "tap1" {
                        cost 10;
                        hello 60;
                        retransmit 2;
                        priority 0;
                        wait 5;
                        dead 120;
                        type ptmp;
                        neighbors { 10.9.253.1; };
                        authentication none;
                };


                interface "eth0.1" {
                        stub yes;
                        cost 1000;
                };

                interface "eth0.3" {
                    stub yes;
                    cost 1000;
                };
        };
}

