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

[sled agent] Add default routes, using GZ addresses as gateways #1147

Merged
merged 8 commits into from
Jun 5, 2022
Merged
Changes from 5 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
22 changes: 21 additions & 1 deletion sled-agent/src/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ impl ServiceManager {
Error::ZoneCommand { intent: "Adding Route".to_string(), err }
})?;

// TODO: Related to
// https://github.com/oxidecomputer/omicron/pull/1124 , should we
// avoid importing this manifest?
debug!(self.log, "importing manifest");

running_zone
Expand All @@ -267,6 +270,23 @@ impl ServiceManager {
let smf_name = format!("svc:/system/illumos/{}", service.name);
let default_smf_name = format!("{}:default", smf_name);

// Ensure the IPv6 traffic can be routed to this non-global zone.
//
// This is particularly important for accessing Nexus' external
// interface from off-device.
running_zone
.run_cmd(&["/usr/sbin/routeadm", "-e", "ipv6-forwarding"])
smklein marked this conversation as resolved.
Show resolved Hide resolved
.map_err(|err| Error::ZoneCommand {
intent: "enabling IPv6 forwarding".to_string(),
err,
})?;
running_zone
.run_cmd(&["/usr/sbin/routeadm", "-e", "ipv6-routing", "-u"])
.map_err(|err| Error::ZoneCommand {
intent: "enabling IPv6 routing".to_string(),
err,
})?;

match service.name.as_str() {
"internal-dns" => {
info!(self.log, "Setting up internal-dns service");
Expand Down Expand Up @@ -469,7 +489,7 @@ mod test {
wait_ctx.expect().return_once(|_, _| Ok(()));
// Import the manifest, enable the service
let execute_ctx = crate::illumos::execute_context();
execute_ctx.expect().times(3).returning(|_| {
execute_ctx.expect().times(5).returning(|_| {
Ok(std::process::Output {
status: std::process::ExitStatus::from_raw(0),
stdout: vec![],
Expand Down