W2·A2 - Bridge the network
Time: 20 min
Needs:: A1's topology
GNS3 project:: w02-a1-dedicated-links (reuse it)
Info
Times listed are approximate and provided as timing guidelines only. Take as much time as you need to complete the activity.
Question
How do you collapse three distinct links into a single network
Do this - build it
On H1:
nmcli con add type bridge ifname br0 con-name br0 connection.autoconnect-slaves 1
nmcli con mod eth0 type bridge-slave master br0
nmcli con mod eth1 type bridge-slave master br0
nmcli con mod br0 ipv4.method manual ipv4.addresses 192.168.10.1/24
nmcli con up br0
Give the bridge a few moments to activate, then:
ip -brief addr show
Do the same on H2 and assign 192.168.10.2/24 to br0
Do the same on H3 and assign 192.168.10.3/24 to br0
What just happened
nmcli con add type bridge ifname br0creates a new type of interface called a bridge and gives it the namebr0.con-name br0: tells NetworkManager to save this interfaces configuration under the name br0connection.autoconnect-slaves 1: tells NetworkManager to start the associated physical interfaces when this interface is activated.
nmcli con mod eth0 type bridge-slave master br0tells NetworkManager to treat the physical interface namedeth0as a port of br0. The next command does the same foreth1- the result is that the devices on the other ends of both
eth0(H2Ethernet0) andeth1(H3Ethernet0) are now on the same link
- the result is that the devices on the other ends of both
- We then assign an address to the bridge interface itself
- Repeating this on
H2andH3essentially places the three nodes on the same link, instead of the three distinct links we had previously.
Do this - test it
On H1:
ping -c1 192.168.10.2
ping -c1 192.168.10.3
What just happened
H1is still able to reachH2andH3, but it now needs just one address to achieve this.- The physical topology is still mesh, but the logical topology is something akin to a star topology
Do this
- Stop all three nodes
- Delete
H2andH3, then renameH1asSW - Drag two VPCS and cable them on to
SW
Log on to SW as root, then:
nmcli con mod br0 -ipv4.addresses 192.168.10.1/24 \
ipv4.method disabled ipv6.method disabled
nmcli con up br0
On PC1:
ip 192.168.10.11/24
save
On PC2:
ip 192.168.10.12/24
save
On PC1:
ping 192.168.10.12 -c 1
What just happened
SWis justH1in new clothes. We disabled IP to show that a bridge is just a link, a medium, and does not need an addressPC1andPC2are cabled to the two ends of the bridge and are able to communicate through it.- You've just created your first "switch"!
If it went wrong
| Sympton | Cause | Fix |
|---|---|---|
| bridge fails to activate | the attached interfaces (ports) are down | start each interface manually, or enable connection.autoconnect-slaves |
ping fails with Destination unreachable |
incorrect address | ensure the address you are trying to ping exists |
ping fails with Network unreachable |
incorrect subnet | check the address at destination and ensure it matches 192.168.10.x |