Port forwarding multiple webservers, DG1670A/TW

I currently have one webserver with django/nginx connected to my Arris router DG1670A/TW (loaned by Spectrum IP provider). Perhaps the following info is superfluous for answering my question but here are the configurations anyway, for my current website:

-‘firewall->port triggers’:
–‘outbound port’ 80-80 and ‘inbound port’ 80-80
–‘outbound port’ 443-443 and ‘inbound port’ 443-443

-‘firewall->virtual servers / port forwarding’:
–‘outbound port’ 80-80 and ‘inbound port’ 80-80
–‘outbound port’ 443-443 and ‘inbound port’ 443-443

Ports 80 and 443 are used for the current website. What is your opinion, advice, answer or alternative solution for 2 servers on one public facing IP: Can I use a 2nd physical server for a 2nd website (different domain name)? It seems to me that default http and https require those ports and setting up a second website would require a user to tediously type ‘www.2ndwebsite.com:8080’ while nginx is configured for listening on port 8080. Perhaps I just need some new hardware to make this work, like a switch?

Windows Server DNS forwarding inside zone

I am using a Windows Server 2019 configured as domain controller with DNS (only secure updates). DNS forwarding to my router is also configured. The mail server is not within Active Directory and therefore uses the DNS service of the router.

Both servers end with “<>.testdomain.local”. How can I get the Windows DNS service to resolve it through the router?

All other addresses (on the Internet) are resolved correctly.

Thank you very much for your help.

Gmail Filter Not Forwarding Email

I have a Gmail filter set up to forward some emails to another account.

Filters

The filter is correctly finding all of the incoming emails and is labeling them “WAVE” as it is supposed to. But it is not forwarding the email as it says it will.

I have already entered the forwarding confirmation code that was sent to the receiving email. I have also followed each of the steps on several tutorials, but to no avail.

Does anyone have any idea what the problem may be?

Implementation of static_vector using an array of std::aligned_storage, with std::launder and forwarding

I’m trying to expand on the implementation of static_vector on the std::aligned_storage reference page, but would like to split it into two parts. First, an aligned_storage_array that supports perfect forwarding (so that I can emplace into it) and doesn’t require a default constructor, and then the actual static_vector infrastructure that builds upon it. This will let me use the aligned_storage_array for some other static data structures I plan to make in the future.

aligned_storage_array.h

#pragma once  #include <array> #include <memory> #include <stdexcept> #include <type_traits>  namespace nonstd {     template<class T, std::size_t N>     struct aligned_storage_array     {     public:         aligned_storage_array() = default;         ~aligned_storage_array() = default;          aligned_storage_array(aligned_storage_array&& rhs)             //requires std::is_move_constructible_v<T>             = default;          aligned_storage_array& operator=(aligned_storage_array&& rhs)             //requires std::is_move_assignable_v<T>             = default;          aligned_storage_array(const aligned_storage_array& rhs)             //requires std::is_copy_constructible_v<T>             = default;          aligned_storage_array& operator=(const aligned_storage_array& rhs)             //requires std::is_copy_assignable_v<T>             = default;          // Size         constexpr std::size_t size() const noexcept { return N; }         constexpr std::size_t max_size() const noexcept { return N; }          // Access         inline T& operator[](std::size_t pos)         {             return *std::launder(                 reinterpret_cast<T*>(                     std::addressof(m_data[pos])));         }          inline const T& operator[](std::size_t pos) const         {             return *std::launder(                 reinterpret_cast<const T*>(                     std::addressof(m_data[pos])));         }          inline T& at(std::size_t pos)         {             return *std::launder(                 reinterpret_cast<T*>(                     std::addressof(m_data.at(pos))));         }          inline const T& at(std::size_t pos) const         {             return *std::launder(                 reinterpret_cast<const T*>(                     std::addressof(m_data.at(pos))));         }          // Operations         template<typename ...Args>         inline T& emplace(size_t pos, Args&&... args)         {             return                 *::new(std::addressof(m_data[pos]))                 T(std::forward<Args>(args)...);         }          template<typename ...Args>         inline T& bounded_emplace(size_t pos, Args&&... args)         {             return                 *::new(std::addressof(m_data.at(pos)))                 T(std::forward<Args>(args)...);         }          inline void destroy(std::size_t pos)         {             std::destroy_at(                 std::launder(                     reinterpret_cast<const T*>(                         std::addressof(m_data[pos]))));         }          inline void bounded_destroy(std::size_t pos)         {             std::destroy_at(                 std::launder(                     reinterpret_cast<const T*>(                         std::addressof(m_data.at(pos)))));         }      private:         std::array<std::aligned_storage_t<sizeof(T), alignof(T)>, N> m_data;     }; } 

static_vector.h

#pragma once  #include <array> #include <stdexcept>  #include "aligned_storage_array.h"  namespace nonstd {     template<class T, std::size_t N>     struct static_vector     {     public:         using value_type            = T;         using pointer               = T*;         using const_pointer         = const T*;         using reference             = value_type&;         using const_reference       = const value_type&;         using iterator              = value_type*;         using const_iterator        = const value_type*;         using size_type             = std::size_t;          static_vector() = default;         ~static_vector() { destroy_n(m_size); }          static_vector(static_vector&& rhs) = default;         static_vector& operator=(static_vector&& rhs) = default;         static_vector(const static_vector& rhs) = default;         static_vector& operator=(const static_vector& rhs) = default;          // Size and capacity         constexpr std::size_t size()      const { return m_size; }         constexpr std::size_t max_size()  const { return N; }         constexpr bool empty()            const { return m_size == 0; }          // Iterators         inline iterator begin()                 { return &m_data[0]; }         inline const_iterator begin()     const { return &m_data[0]; }         inline iterator end()                   { return &m_data[m_size]; }         inline const_iterator end()       const { return &m_data[m_size]; }          // Access         inline T& operator[](std::size_t pos)         {             return m_data[pos];         }          inline const T& operator[](std::size_t pos) const         {             return m_data[pos];         }          inline T& at(std::size_t pos)         {             if (pos >= m_size)                 throw std::out_of_range("static_vector subscript out of range");             return m_data.at(pos);         }          inline const T& at(std::size_t pos) const         {             if (pos >= m_size)                 throw std::out_of_range("static_vector subscript out of range");             return m_data.at(pos);         }          // Operations         template<typename ...Args>         inline T& emplace_back(Args&&... args)         {             T& result = m_data.bounded_emplace(m_size, args...);             ++m_size;             return result;         }          inline void clear()         {             std::size_t count = m_size;             m_size = 0; // In case of exception             destroy_n(count);         }      private:         void destroy_n(std::size_t count)         {             for (std::size_t pos = 0; pos < count; ++pos)                 m_data.destroy(pos);         }          aligned_storage_array<T, N> m_data;         std::size_t m_size = 0;     }; } 

A full functional test setup is available here (wandbox). The concept lines can be uncommented and will parse in a compiler that supports them. Mostly I’d like some extra eyes to help determine:

  1. Is this actually safe for placement new with respect to alignment?
  2. Is the use of std::launder correct?
  3. Is the use of reinterpret_cast correct (or should it be two static_casts instead?)
  4. Are there any hidden pitfalls I should watch out for here (aside from the maximum capacity)?
  5. Am I being sufficiently paranoid (::new, std::address_of, std::destroy_at)? Any other safety features I can put in to handle risky operator overloads?
  6. How should I actually handle copy and move? The aligned_storage will happily copy irrespective of whether or not T actually has copy and move functions. I don’t think these concepts are enough because I’m not calling the actual constructors or operators. However in the array base I don’t know which entries are and aren’t valid to copy/move.

I’m told this is similar to something like boost::small_vector, but I want the aligned_storage_array generalized because I want to use it for a number of different static structures later. Also I would like to learn more about alignment/placement new, forwarding, and launder.

Thank you!

Android 9 – IP forwarding

Apparently after updating my device to android 9 ip forwarding now seems to be an issue. Packets aren’t being forwarded.

Before on android 8, I’d simply run “sysctl -w net.ipv4.ip_forward = 1” and the forward command on iptables which would allow me to act as a proxy.

I’ve tried all sorts of things on android 9 and nothing seems to work. I’ve even changed ROM and that doesn’t help.

Does anyone know if they’ve changed something in the OS (android 9) or is it just my device?

I’m on the pocophone f1, any help is greatly appreciated.

How to remedy TLS handshake issue while forwarding packets between two NATs?

There is a local network with Wifi router working as NAT server, which is connected to an ISP. It’s needed to place a firewall between the router and ISP which filters incoming and outcoming traffic, because the router’s built-in firewall is too simplistic.

So a machine with two NICs (the intended firewall), running Debian Stretch was added between the router and ISP:

[Wifi router(NAT server)]- - - - -[eth1]=[firewall(NAT server)]=[ppp0]      |                                                            |      |                                                            |      |                                                            | [local network]                                                 [ISP] 

Currently, the firewall is tested only on forwarding packets between ISP and the router, so only three forwarding iptables rules were added to it:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i eth1 -o ppp0 -j ACCEP 

These rules apparently are not sufficient for performing a flawless forwarding because some https addresses cannot be opened anymore in browsers in the local network and freeze with the “Perfoming TLS handshaking…” line in the status bar.

Notably, almost all major websites such as gmail, youtube, bing, reddit etc. doesn’t have this problem. So the cause of this problem lies maybe in different TLS protocol versions, or different certificate classes or different configuration etc.

How can this problem be remedied?

Port Forwarding vs Port Triggering for online game Elder Scrolls Online [migrated]

My system is Windows 10 on a TP-Link WDR3600 router (no VPN). I use this computer for banking and other important things. I’m no network engineer but I’ve heard port forwarding puts you more at risk and would like to know your thoughts vs port triggering. I’m not even sure I got the port forwarding working (I believe it was successful).

Secondly how do I check if the ports are open while gaming and port triggering? Open Port Check Tool does not seem to work so I grabbed Simple Port Forwarding exe, which I’m not sure works for the port triggering. Do I need to somehow track which ports are open while running the game? My understanding is that port triggering will only open the ports when my computer ‘asks’ for the port via my game initializing. After the game closes, the ports get closed as well. Is this right?

Gmail forwarding verification code problem

I’m trying to get someone to receive forwarded emails. I put in his email address. He received the message, but the account I’m sending from doesn’t recognize his computer. So it wants to send the verification code to his phone, but it’s saying his phone isn’t registered with the account either. How can he get the code? How do I get him registered to receive forwarded emails?