Tuesday, March 22, 2011

Command Line File Based Network Devices Settings

Step 1. : get N/W config data.

#! /bin/bash

 system-config-network-cmd -d >net_device_data.txt

Step 2. : Edit the file with required changes

cat net_device_data.txt

DeviceList.Ethernet.eth0.AutoDNS=true
DeviceList.Ethernet.eth0.HardwareAddress=00:08:a1:ee:63:18
DeviceList.Ethernet.eth0.Type=Ethernet
DeviceList.Ethernet.eth0.IPv6Init=false
DeviceList.Ethernet.eth0.Netmask=255.255.255.0
DeviceList.Ethernet.eth0.BootProto=none
DeviceList.Ethernet.eth0.Device=eth0
DeviceList.Ethernet.eth0.OnBoot=true
DeviceList.Ethernet.eth0.IP=192.168.1.63
DeviceList.Ethernet.eth0.DeviceId=eth0
DeviceList.Ethernet.eth0.AllowUser=false
DeviceList.Ethernet.eth0.Gateway=192.168.3.63
DeviceList.Ethernet.eth1.HardwareAddress=00:e0:4c:D9:0a:c6
DeviceList.Ethernet.eth1.Type=Ethernet
DeviceList.Ethernet.eth1.IPv6Init=false
DeviceList.Ethernet.eth1.Netmask=255.255.255.240
DeviceList.Ethernet.eth1.BootProto=none
DeviceList.Ethernet.eth1.Device=eth1
DeviceList.Ethernet.eth1.OnBoot=true
DeviceList.Ethernet.eth1.IP=15.1.5.179
DeviceList.Ethernet.eth1.DeviceId=eth1
DeviceList.Ethernet.eth1.AllowUser=false
DeviceList.Ethernet.eth1.Gateway=15.1.5.177

Update N/W details .


Step3 .: update the new changes


#! /bin/bash

system-config-network-cmd -i -f net_device_data_save.txt


Result : helpfull for N/W setting with any web user interface  .



No comments: