dual network interfaces and internet

riky67

Renowned Member
Mar 23, 2012
6
0
66
I am using a proxmox server for study connected in two ways:
1) with a network cable (in dhcp mode 10.2.x.x network, interface enp0s31f6);
2) with USB smartphone in thettering mode (also in dhcp mode 192.168.42 x network, interface enx02566336606c ).
I would like all internet traffic to pass through the mobile network enx02566336606c both for the docker server (update and install) and for the virtual machines

ip route show
default via 10.2.0.102 dev vmbr0 proto kernel onlink
10.2.0.0/16 dev vmbr0 proto kernel scope link src 10.2.8.151
10.2.0.0/16 dev enp0s31f6 proto kernel scope link src 10.2.8.151
192.168.42.0/24 dev enx02566336606c proto kernel scope link src 192.168.42.221

Grazie
 
If you don't want to mess around with iptables and routing and the like, I would recommend setting up an LXC container with squid and pihole.

1st network interface = DHCP connected to the tether, gets its Internet address from the phone
2nd network interface = bridged to internal LAN with a static IP, point all proxy settings to this address.

Should be fairly easy to setup and conceptually easy to maintain / document / admin.