This is a newbie question I get quite often.
Configuring your Linux machine to run on a static IP is easy. Tools like system-config-network and netconfig provide you simple GUIs to do this.
For today, I’ll show you how to do this from the command line instead.
Navigate to /etc/sysconfig/network-scripts/
[root@baboo]# cd /etc/sysconfig/network-scripts/
Every network interface will have it’s own interface script file. eth0,eth1,eth2 and so on. Vi the ifcfg-eth0 interface script file for interface eth0. Replace the contents of the ifcfg-eth0 file with the parameters below.
[root@baboo]# vi ifcfg-eth0.
DEVICE=eth1
BOOTPROTO=none
HWADDR=A4:BA:DB:2C:4F:58
ONBOOT=yes
HOTPLUG=no
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=10.65.10.106
GATEWAY=10.65.10.254
Restart your interface to apply the changes.
[root@baboo]#ifdown eth0
[root@baboo]#ifup eth0
For further reading Click here
Configuring your Linux machine to run on a static IP is easy. Tools like system-config-network and netconfig provide you simple GUIs to do this.
For today, I’ll show you how to do this from the command line instead.
Navigate to /etc/sysconfig/network-scripts/
[root@baboo]# cd /etc/sysconfig/network-scripts/
Every network interface will have it’s own interface script file. eth0,eth1,eth2 and so on. Vi the ifcfg-eth0 interface script file for interface eth0. Replace the contents of the ifcfg-eth0 file with the parameters below.
[root@baboo]# vi ifcfg-eth0.
DEVICE=eth1
BOOTPROTO=none
HWADDR=A4:BA:DB:2C:4F:58
ONBOOT=yes
HOTPLUG=no
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=10.65.10.106
GATEWAY=10.65.10.254
Restart your interface to apply the changes.
[root@baboo]#ifdown eth0
[root@baboo]#ifup eth0
For further reading Click here
No comments:
Post a Comment