Automate network setup as we have switch between Nat and internal network multiple times or bring a new machine into this network
You might need to put your vm back on internet for some time. THis is how you can do it.
scripts to setup NAT network and internal network on remnux.
First set your network adapter to internal then use netplan.
Filename: 01-netcfg_internal.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
addresses: [10.0.0.3/24]
gateway4: 10.0.0.1
dhcp6: yes
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: yes
dhcp6: yes
set your machien in internal network and then run this bat script and run as administrator
@echo off
netsh interface ip set address name="Ethernet" static 10.0.0.4 255.255.255.0 10.0.0.3
netsh interface ip set dns name="Ethernet" static 10.0.0.3
set your machine in nat mode and run this script as administrator
@echo off
netsh interface ip set address name="Ethernet" dhcp
netsh interface ip set dns name="Ethernet" dhcp
where is "Ethernet" is your network interface name, use this command to find your interface