Two Networks Domain (No Internet) and Internet

Good Evening Interwebs,

Good Evening Interwebs,

I got a problem while setting up my VMs to for a Project this evening.

I got the following situation:
My VMs are participating a existing domain infrastructure and I need to use these resources in my Project, also I need unfiltered Internet access, that was provided me by seperate VLAN on a seperate NIC.

So then I thought how do I tell the System to access the Internet through the Internet interface without cutting the domain network which also has routed vlans, so only settings the default gateway doesn’t work here.

Solution for a CentOS 7 Setup:
1. Set your domain NIC to ignore the default route provided by dhcp
/etc/sysconfig/network-scripts/ifcfg-ens160:
 — DEFROUTE=no

2. Set your internet NIC to ignore DNS parameters provided by dhcp
/etc/sysconfig/network-scripts/ifcfg-ens160:
 — PEERDNS=no

Note: this works only when your Domain DNS is also resolving to Public DNS

3. add a new route simple using a summary rule to route domain traffic to the domain network (ip route add 10.0.0.0/8 via 10.0.0.1 metric 101)
/etc/sysconfig/network-scripts/route-ens160:
 — 10.0.0.0/8 via 10.0.0.1 metric 101