Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local pref 1 #103

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/basic_bgp/local_pref/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![topology](topo.png "bgp")
145 changes: 145 additions & 0 deletions examples/basic_bgp/local_pref/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
nodes:
- name: R1
image: frrouting/frr:latest
docker_run_extra_args: --entrypoint bash
interfaces:
- { name: net0, type: direct, args: R2#net0 }
- { name: net1, type: direct, args: R3#net0 }
- { name: net2, type: direct, args: R4#net0 }
sysctls:
- sysctl: net.ipv6.conf.all.disable_ipv6=0
- sysctl: net.ipv6.conf.default.disable_ipv6=0
- sysctl: net.ipv4.ip_forward=1
- name: R2
image: frrouting/frr:latest
docker_run_extra_args: --entrypoint bash
interfaces:
- { name: net0, type: direct, args: R1#net0 }
sysctls:
- sysctl: net.ipv6.conf.all.disable_ipv6=0
- sysctl: net.ipv6.conf.default.disable_ipv6=0
- sysctl: net.ipv4.ip_forward=1
- name: R3
image: frrouting/frr:latest
docker_run_extra_args: --entrypoint bash
interfaces:
- { name: net0, type: direct, args: R1#net1 }
- { name: net1, type: direct, args: R5#net0 }
sysctls:
- sysctl: net.ipv6.conf.all.disable_ipv6=0
- sysctl: net.ipv6.conf.default.disable_ipv6=0
- sysctl: net.ipv4.ip_forward=1
- name: R4
image: frrouting/frr:latest
docker_run_extra_args: --entrypoint bash
interfaces:
- { name: net0, type: direct, args: R1#net2 }
- { name: net1, type: direct, args: R5#net1 }
sysctls:
- sysctl: net.ipv6.conf.all.disable_ipv6=0
- sysctl: net.ipv6.conf.default.disable_ipv6=0
- sysctl: net.ipv4.ip_forward=1
- name: R5
image: frrouting/frr:latest
docker_run_extra_args: --entrypoint bash
interfaces:
- { name: net0, type: direct, args: R3#net1 }
- { name: net1, type: direct, args: R4#net1 }
sysctls:
- sysctl: net.ipv6.conf.all.disable_ipv6=0
- sysctl: net.ipv6.conf.default.disable_ipv6=0
- sysctl: net.ipv4.ip_forward=1
node_configs:
- name: R1
cmds:
- cmd: sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons
- cmd: sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh start
- cmd: ip addr add 10.0.0.1/24 dev net0
- cmd: ip addr add 10.1.0.1/24 dev net1
- cmd: ip addr add 10.2.0.1/24 dev net2
- cmd: >-
vtysh -c "conf t"
-c "router bgp 65001"
-c "no bgp ebgp-requires-policy"
-c ' bgp router-id 1.1.1.1'
-c "neighbor 10.0.0.2 remote-as 65002"
-c "neighbor 10.1.0.2 remote-as 65003"
-c "neighbor 10.2.0.2 remote-as 65004"
-c ' address-family ipv4 unicast'
-c ' redistribute connected'
-c ' neighbor 10.2.0.2 route-map LOCAL_PREF200 in'
-c ' exit-address-family'
-c 'access-list 1 permit 10.11.0.0/24'
-c 'route-map LOCAL_PREF200 permit 10'
-c ' match ip address 1'
-c ' set local-preference 200'
-c ' exit'
-c 'route-map LOCAL_PREF200 permit 20'
-c '!'
- name: R2
cmds:
- cmd: sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh start
- cmd: ip addr add 10.0.0.2/24 dev net0
- cmd: >-
vtysh -c "conf t"
-c "router bgp 65002"
-c "no bgp ebgp-requires-policy"
-c ' bgp router-id 1.1.1.2'
-c "neighbor 10.0.0.1 remote-as 65001"
-c ' address-family ipv4 unicast'
-c ' redistribute connected'
-c ' exit-address-family'
-c '!'
- name: R3
cmds:
- cmd: sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh start
- cmd: ip addr add 10.1.0.2/24 dev net0
- cmd: ip addr add 10.11.0.1/24 dev net1
- cmd: >-
vtysh -c "conf t"
-c "router bgp 65003"
-c "no bgp ebgp-requires-policy"
-c ' bgp router-id 1.1.1.3'
-c "neighbor 10.1.0.1 remote-as 65001"
-c "neighbor 10.11.0.2 remote-as 65005"
-c ' address-family ipv4 unicast'
-c ' redistribute connected'
-c ' exit-address-family'
-c '!'
- name: R4
cmds:
- cmd: sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh start
- cmd: ip addr add 10.2.0.2/24 dev net0
- cmd: ip addr add 10.12.0.1/24 dev net1
- cmd: >-
vtysh -c "conf t"
-c "router bgp 65004"
-c "no bgp ebgp-requires-policy"
-c ' bgp router-id 1.1.1.4'
-c "neighbor 10.2.0.1 remote-as 65001"
-c "neighbor 10.12.0.2 remote-as 65005"
-c ' address-family ipv4 unicast'
-c ' redistribute connected'
-c ' exit-address-family'
-c '!'
- name: R5
cmds:
- cmd: sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons
- cmd: /usr/lib/frr/frrinit.sh start
- cmd: ip addr add 10.11.0.2/24 dev net0
- cmd: ip addr add 10.12.0.2/24 dev net1
- cmd: >-
vtysh -c "conf t"
-c "router bgp 65005"
-c "no bgp ebgp-requires-policy"
-c ' bgp router-id 1.1.1.5'
-c "neighbor 10.11.0.1 remote-as 65003"
-c "neighbor 10.12.0.1 remote-as 65004"
-c ' address-family ipv4 unicast'
-c ' redistribute connected'
-c ' exit-address-family'
-c '!'
Binary file added examples/basic_bgp/local_pref/topo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.