Open konosubakonoakua opened 2 months ago
#!/bin/bash
export NIC=eno1
export GATEWAY=192.168.137.1
export IP0=192.168.137.2
export IP1=10.9.8.8
export IP2=10.10.9.235
export CONNECTION=$(nmcli -t -f DEVICE,CONNECTION device status | grep $NIC | awk -F: '{print $2}')
sudo nmcli connection modify "$CONNECTION" ipv4.addresses $IP0/24
sudo nmcli connection modify "$CONNECTION" ipv4.gateway $GATEWAY
sudo nmcli connection modify "$CONNECTION" ipv4.dns $GATEWAY
sudo nmcli connection modify "$CONNECTION" ipv4.method manual
sudo nmcli connection modify "$CONNECTION" +ipv4.addresses $IP1/24
sudo nmcli connection modify "$CONNECTION" +ipv4.addresses $IP2/24
sudo nmcli connection up "$CONNECTION"
ip route show
then we get
computer A with working network (windows)