-
Notifications
You must be signed in to change notification settings - Fork 52
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
update sample scripts to use iproute #165
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,14 @@ NEW_MTU="$5" | |
. scripts/bridge_functions.sh | ||
|
||
# Remove interface from old bridge | ||
brctl delif digger${OLD_MTU} $INTERFACE | ||
ip link set dev $INTERFACE nomaster | ||
|
||
# Change interface MTU | ||
ip link set dev $INTERFACE mtu $NEW_MTU | ||
|
||
# Add interface to new bridge | ||
# Change interface MTU and add to new bridge | ||
ensure_bridge digger${NEW_MTU} | ||
brctl addif digger${NEW_MTU} $INTERFACE | ||
ip link set dev $INTERFACE master digger${NEW_MTU} mtu $NEW_MTU | ||
|
||
# Turn on bridge port isolation | ||
bridge link set dev $INTERFACE isolated on | ||
|
||
# Bring the tunnel interface up only after port isolation is enabled | ||
ip link set dev $INTERFACE up | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that just removing the interface from the old bridge does not bring the interface down. So, I suggest just after removing the interface from the old bridge, do an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will need to test this. Conversely, if what you say is true we could, things should continue to work even if we don't bring up the interface as we add it to the bridge for the new MTU value. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,12 @@ LOCAL_BROKER_PORT="$9" | |
|
||
. scripts/bridge_functions.sh | ||
|
||
# Set the interface to UP state | ||
ip link set dev $INTERFACE up mtu $MTU | ||
|
||
# Add the interface to our bridge | ||
ensure_bridge digger${MTU} | ||
brctl addif digger${MTU} $INTERFACE | ||
ip link set dev $INTERFACE master digger${MTU} mtu $MTU | ||
|
||
# Turn on bridge port isolation | ||
bridge link set dev $INTERFACE isolated on | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks nicer than ebtables indeed, but OTOH there is a race condition here now, is there? Between the time this is added to the bridge, and when this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing this out. I think you might be right. Maybe we can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would a similar "isolated on" be needed in the mtu_changed script? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just checked, and yes, it would be necessary to set to isolated again when changing bridges with the mtu script. The port status can be seen in /sys/class/net/$INTERFACE/brport/isolated Also, it's not necessary to use the bridge command. You can also simply There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed a fix to my branch. Thanks for testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still recommend doing the port isolation with This is most likely only important for embedded devices which try to minimize the amount of packages installed on the system. |
||
|
||
# Bring the tunnel interface up only after port isolation is enabled | ||
ip link set dev $INTERFACE up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why didn't you put the
isolation on
here? That would avoid having to audit all places whereensure_bridge
is used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to do the isolation per port, and isolating the bridge interface itself would mean that none of the attached bridge porst would be able to communicate with host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmelange is correct.
isolation on
is a function of the bridge port, not the bridge itself. As such it would functionally belong into the session handler scripts.