Skip to content

Commit

Permalink
tun: add destination
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Oct 27, 2024
1 parent 1cccdc6 commit dd82359
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/packet_sources/tun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ impl PacketSourceConf for TunConf {
) -> Result<(Self::Task, Self::Data)> {
let mut config = tun2::Configuration::default();
config.mtu(MAX_PACKET_SIZE as u16);
// Setting a local address is required on Linux.
config.address("169.254.0.1");
// Setting a local address and a destination is required on Linux.
config.address("169.254.0.2");
config.destination("169.254.0.1");
config.up();
if let Some(tun_name) = self.tun_name {
config.tun_name(&tun_name);
Expand Down

0 comments on commit dd82359

Please sign in to comment.