-
-
Save anonymous/a5547b0b98a9e29f6e52b7142072b905 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a logical switches "ls1" and "ls2". | |
sudo ovn-nbctl ls-add ls1 | |
sudo ovn-nbctl ls-add ls2 | |
# Create logical port on "ls1" and "ls2". | |
sudo ovn-nbctl lsp-add ls1 ls1-port1 | |
sudo ovn-nbctl lsp-add ls2 ls2-port1 | |
# Set a MAC address for each of the two logical ports. | |
sudo ovn-nbctl lsp-set-addresses ls1-port1 00:00:00:00:00:01 | |
sudo ovn-nbctl lsp-set-addresses ls2-port1 00:00:00:00:00:02 | |
# Set up port security for the two logical ports. | |
sudo ovn-nbctl lsp-set-port-security ls1-port1 00:00:00:00:00:01 | |
sudo ovn-nbctl lsp-set-port-security ls2-port1 00:00:00:00:00:02 | |
# Add a logical router, so 1.0.0.1 can reach 2.0.0.1 | |
sudo ovn-nbctl lr-add lr0 | |
sudo ovn-nbctl lrp-add lr0 lrp1 00:00:00:01:00:01 1.0.0.2/24 peer=lrp1-attachment | |
sudo ovn-nbctl -- lsp-add ls1 lrp1-attachment \ | |
-- set Logical_Switch_Port lrp1-attachment \ | |
type=router \ | |
options:router-port=lrp1 \ | |
addresses='"00:00:00:01:00:01 1.0.0.2"' | |
sudo ovn-nbctl lrp-add lr0 lrp2 00:00:00:01:00:02 2.0.0.2/24 peer=lrp2-attachment | |
sudo ovn-nbctl -- lsp-add ls2 lrp2-attachment \ | |
-- set Logical_Switch_Port lrp2-attachment \ | |
type=router \ | |
options:router-port=lrp2 \ | |
addresses='"00:00:00:01:00:02 2.0.0.2"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment