mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
guest: setup loopback interface
This commit is contained in:
parent
8ec7042ea4
commit
693d62a41a
@ -340,6 +340,14 @@ impl GuestInit {
|
|||||||
let (connection, handle, _) = rtnetlink::new_connection()?;
|
let (connection, handle, _) = rtnetlink::new_connection()?;
|
||||||
tokio::spawn(connection);
|
tokio::spawn(connection);
|
||||||
|
|
||||||
|
let mut links = handle.link().get().match_name("lo".to_string()).execute();
|
||||||
|
let Some(link) = links.try_next().await? else {
|
||||||
|
warn!("unable to find link named lo");
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
|
handle.link().set(link.header.index).up().execute().await?;
|
||||||
|
|
||||||
let ipv4_network: IpNetwork = network.ipv4.address.parse()?;
|
let ipv4_network: IpNetwork = network.ipv4.address.parse()?;
|
||||||
let ipv4_gateway: Ipv4Addr = network.ipv4.gateway.parse()?;
|
let ipv4_gateway: Ipv4Addr = network.ipv4.gateway.parse()?;
|
||||||
let ipv6_network: IpNetwork = network.ipv6.address.parse()?;
|
let ipv6_network: IpNetwork = network.ipv6.address.parse()?;
|
||||||
|
Loading…
Reference in New Issue
Block a user