@@ -36,6 +36,7 @@ typedef struct
3636{
3737 uint32_t LeaseTimeInSeconds;
3838 bool Lwip;
39+ bool HostedNetwork;
3940 std::string ComponentId;
4041 boost::asio::ip::address IPAddress;
4142 boost::asio::ip::address GatewayServer;
@@ -123,6 +124,7 @@ bool PppApplication::PreparedLoopbackEnvironment(bool client_or_server, const st
123124 network_interface->GatewayServer .to_string (),
124125 network_interface->SubmaskAddress .to_string (),
125126 network_interface->LeaseTimeInSeconds ,
127+ network_interface->HostedNetwork ,
126128 Ipep::AddressesTransformToStrings (network_interface->DnsAddresses ));
127129 if (NULL == tap)
128130 {
@@ -261,11 +263,13 @@ void PppApplication::PrintHelpInformation() noexcept
261263 messages += " --tun-ip=10.0.0.2 \\\r\n " ;
262264 messages += " --tun-gw=10.0.0.0 \\\r\n " ;
263265 messages += " --tun-mask=30 \\\r\n " ;
266+ messages += " --tun-host=[true|false] \\\r\n " ;
264267 messages += " --tun-lease-time-in-seconds=7200 \\\r\n " ;
265268#else
266269 messages += " --tun-ip=10.0.0.2 \\\r\n " ;
267270 messages += " --tun-gw=10.0.0.1 \\\r\n " ;
268271 messages += " --tun-mask=30 \\\r\n " ;
272+ messages += " --tun-host=[true|false] \\\r\n " ;
269273#endif
270274
271275 messages += " --dns=8.8.8.8,8.8.4.4 \\\r\n " ;
@@ -380,7 +384,7 @@ std::shared_ptr<NetworkInterface> PppApplication::GetNetworkInterface(int argc,
380384 ni->IPAddress = GetNetworkAddress (" --tun-ip" , " 10.0.0.2" , argc, argv);
381385 ni->GatewayServer = GetNetworkAddress (" --tun-gw" , " 10.0.0.0" , argc, argv);
382386 ni->SubmaskAddress = GetNetworkAddress (" --tun-mask" , " 255.255.255.252" , argc, argv);
383-
387+
384388 // DHCP-MASQ lease time in seconds.
385389 ni->LeaseTimeInSeconds = strtoul (ppp::GetCommandArgument (" --tun-lease-time-in-seconds" , argc, argv).data (), NULL , 10 );
386390 if (ni->LeaseTimeInSeconds < 1 )
@@ -394,7 +398,9 @@ std::shared_ptr<NetworkInterface> PppApplication::GetNetworkInterface(int argc,
394398 ni->SubmaskAddress = GetNetworkAddress (" --tun-mask" , " 255.255.255.252" , argc, argv);
395399#endif
396400
401+ // Enabled the vEthernet bearer network to take over the Layer L2/L3 vEthernet traffic of the entire operating system.
397402 ni->IPAddress = Ipep::FixedIPAddress (ni->IPAddress , ni->GatewayServer , ni->SubmaskAddress );
403+ ni->HostedNetwork = ppp::ToBoolean (ppp::GetCommandArgument (" --tun-host" , argc, argv).data ());
398404
399405#ifdef _WIN32
400406 ni->ComponentId = ppp::tap::TapWindows::FindComponentId (ppp::GetCommandArgument (" --tun" , argc, argv));
0 commit comments