Solution
You can use the command below to change the network settings from Static to DHCP as shown below.
nirtcfg --set section=ETH1,token=dhcpenabled,value=1You can use the command below to change the network settings for Subnet mask, Gateway and DNS:
- Subnet mask: nirtcfg --set section=ETH1,token=Subnet_Mask,value=255.255.255.0
- Gateway: nirtcfg --set section=ETH1,token=Gateway,value=10.161.81.1
- DNS: nirtcfg --set section=ETH1,token=DNS_Address,value=10.161.81.1
Note: It is compulsory to restart the network after modifying to make sure the network settings are properly configured. You can restart it by using the following command:
/etc/init.d/networking restart