Generally when a network is configured from virsh-define for a particular range say 192.168.4.0 it gateway will be automatically assigned to 192.168.4.1, if the gateway wants to be changed to 192.168.4.2 then it can be done by using virsh-net edit command line option from cli.
<route family=’ipv4′ address=’192.168.4.0′ prefix=’24’ gateway=’192.168.4.2’/>
Check the existing virsh networks
cipher ~ virsh net-list Name State Autostart Persistent ---------------------------------------------------------- cipher-nat1 active yes yes cipher-nat2 active yes yes cipher-nat3 active yes yes default active yes yes docker-machines active yes yes
Stop the network , make configuration changes then start it.
cipher ~ virsh net-destroy cipher-nat2 Network cipher-nat2 destroyed cipher ~ virsh net-edit cipher-nat2cipher ~ virsh net-start cipher-nat2 Network cipher-nat2 started cipher-nat2 b47815b6-9f2d-4dcb-8ddf-bebddb5c969d