mirror of
https://github.com/knorrie/network-examples
synced 2025-08-30 05:58:31 +00:00
how to actually call fixnetwork.sh
It was a bit unclear for me, what to do with fixnetwork.sh script. This modifications should help to avoid confusion Edit by Knorrie: * Fix up some whitespace * Make fixnetwork executable, it already had a shebang * Copy both router and host files, if present: [RH]*
This commit is contained in:
parent
23422efe21
commit
d41fdd708d
@ -20,16 +20,23 @@ Well, you know the drill. :-)
|
||||
|
||||
Thankfully, most of the configuration is provided already, so we can quickly set up this whole network using our LXC environment. Just like in the previous tutorials, the birdbase container can be cloned, after which the lxc network information and configuration inside the containers can be copied into them.
|
||||
|
||||
1. Clone this git repository somewhere to be able to use some files from the bgp-contd/lxc/ directory inside.
|
||||
1. Clone this git repository somewhere to be able to use some files from the bgp-contd/lxc/ directory inside:
|
||||
|
||||
cd ~
|
||||
git clone https://github.com/knorrie/network-examples.git
|
||||
|
||||
2. lxc-copy the birdbase container several times:
|
||||
|
||||
for router in 0 1 2 10 11 12 20; do lxc-copy -s -n birdbase -N R$router; done
|
||||
|
||||
3. Set up the network interfaces in the lxc configuration. This can be done by removing all network related configuration that remains from the cloned birdbase container, and then appending all needed interface configuration by running the fixnetwork.sh script that can be found in `bgp-contd/lxc/` in this git repository. Of course, have a look at the contents of the script first, before executing it.
|
||||
|
||||
. ./fixnetwork.sh
|
||||
cd /var/lib/lxc
|
||||
~/network-examples/bgp-contd/lxc/fixnetwork.sh
|
||||
|
||||
4. Copy extra configuration into the containers. The bgp-intro/lxc/ directory inside this git repository contains a little file hierarchy that can just be copied over the configuration of the containers. For each router, it's a network/interfaces configuration file which adds an IP address that corresponds with the Router ID to the loopback interface, and a simple BIRD configuration file that serves as a starting point for our next steps.
|
||||
4. Copy extra configuration into the containers. The bgp-contd/lxc/ directory inside this git repository contains a little file hierarchy that can just be copied over the configuration of the containers. For each router, it's a network/interfaces configuration file whcih adds an IP address that corresponds with the Router ID to the loopback interface, and a simple BIRD configuration file that serves as a starting point for our next steps:
|
||||
|
||||
cp ~/network-examples/bgp-contd/lxc/[RH]* . -r
|
||||
|
||||
5. Start all containers
|
||||
|
||||
|
0
bgp-contd/lxc/fixnetwork.sh
Normal file → Executable file
0
bgp-contd/lxc/fixnetwork.sh
Normal file → Executable file
@ -45,7 +45,11 @@ Our networks start to look serious now! It might be handy to print this image so
|
||||
|
||||
Thankfully, most of the configuration is provided already, so we can quickly set up this whole network using our LXC environment. Just like in the previous tutorial, the birdbase container can be cloned, after which the lxc network information and configuration inside the containers can be copied into them.
|
||||
|
||||
1. Clone this git repository somewhere to be able to use some files from the bgp-intro/lxc/ directory inside.
|
||||
1. Clone this git repository somewhere to be able to use some files from the bgp-intro/lxc/ directory inside:
|
||||
|
||||
cd ~
|
||||
git clone https://github.com/knorrie/network-examples.git
|
||||
|
||||
2. lxc-copy the birdbase container several times:
|
||||
|
||||
lxc-copy -s -n birdbase -N R0
|
||||
@ -61,10 +65,13 @@ Thankfully, most of the configuration is provided already, so we can quickly set
|
||||
|
||||
3. Set up the network interfaces in the lxc configuration. This can be done by removing all network related configuration that remains from the cloned birdbase container, and then appending all needed interface configuration by running the fixnetwork.sh script that can be found in `bgp-intro/lxc/` in this git repository. Of course, have a look at the contents of the script first, before executing it.
|
||||
|
||||
. ./fixnetwork.sh
|
||||
cd /var/lib/lxc
|
||||
~/network-examples/bgp-intro/lxc/fixnetwork.sh
|
||||
|
||||
4. Copy extra configuration into the containers. The bgp-intro/lxc/ directory inside this git repository contains a little file hierarchy that can just be copied over the configuration of the containers. For each router, it's a network/interfaces configuration file which adds an IP address that corresponds with the Router ID to the loopback interface, and a simple BIRD configuration file that serves as a starting point for our next steps.
|
||||
|
||||
cp ~/network-examples/bgp-intro/lxc/[RH]* . -r
|
||||
|
||||
5. Start all containers
|
||||
|
||||
for router in 0 1 3 10 11 12; do lxc-start -d -n R$router; sleep 2; done
|
||||
|
0
bgp-intro/lxc/fixnetwork.sh
Normal file → Executable file
0
bgp-intro/lxc/fixnetwork.sh
Normal file → Executable file
@ -82,7 +82,11 @@ Let's build some containers! If you don't have [a lab environment](/lxcbird/READ
|
||||
|
||||
To create the eight containers we need, connected together in different networks, the following steps are needed:
|
||||
|
||||
1. Clone this git repository somewhere to be able to use some files from the ospf-intro/lxc/ directory inside.
|
||||
1. Clone this git repository somewhere to be able to use some files from the ospf-intro/lxc/ directory inside:
|
||||
|
||||
cd ~
|
||||
git clone https://github.com/knorrie/network-examples.git
|
||||
|
||||
2. lxc-copy the birdbase container several times:
|
||||
|
||||
lxc-copy -s -n birdbase -N R1
|
||||
@ -96,10 +100,13 @@ To create the eight containers we need, connected together in different networks
|
||||
|
||||
3. Set up the network interfaces in the lxc configuration. This can be done by removing all network related configuration that remains from the cloned birdbase container, and then appending all needed interface configuration by running the fixnetwork.sh script that can be found in `ospf-intro/lxc/` in this git repository. Of course, have a look at the contents of the script first, before executing it. Since this example is only using IPv4 and single IP addresses on the interfaces, I simply added them to the lxc configuration instead of the network/interfaces file inside the container.
|
||||
|
||||
. ./fixnetwork.sh
|
||||
cd /var/lib/lxc
|
||||
~/network-examples/ospf-intro/lxc/fixnetwork.sh
|
||||
|
||||
4. Copy extra configuration into the containers. The ospf-intro/lxc/ directory inside this git repository contains a little file hierarchy that can just be copied over the configuration of the containers. For each router, it's a network/interfaces configuration file which adds an IP address that corresponds with the Router ID to the loopback interface, and a simple BIRD configuration file that serves as a starting point for our next steps.
|
||||
|
||||
cp ~/network-examples/ospf-intro/lxc/[RH]* . -r
|
||||
|
||||
5. Start all containers
|
||||
|
||||
for router in 1 2 5 6; do lxc-start -d -n R$router; sleep 2; done
|
||||
|
0
ospf-intro/lxc/fixnetwork.sh
Normal file → Executable file
0
ospf-intro/lxc/fixnetwork.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user