Set the IP address in the ubuntu command line
Cat/etc/network/interfaces
# This file describes the network interfaces available on your system
# And how to activate them. For more information, see interfaces (5 ).
# The loopback network interface
Auto lo
Iface lo inet loopback
# The primary network interface
Auto eth0
Iface eth0 inet static
Address 192.168.1.104
Netmask 255.255.255.0
Network 192.168.1.0
Broadcast 192.168.1.255
Gateway 192.168.1.2
# Dns-* options are implemented by the resolvconf package, if installed
Dns-nameservers 58.22.96.66 218.104.128.106 202.101.138.8
Dns-search. COM
Restart the NIC:/etc/init. d/networking restatr
Set the IP address in the command line of redhat linux:
Ifconfig eth0 new ip
Then edit/etc/sysconfig/network-scripts/ifcfg-eth0 and modify the ip
1. Modify the IP address
[Aeolus @ database network-scripts] $ vi ifcfg-eth0
DEVICE = eth0
ONBOOT = yes
BOOTPROTO = static
IPADDR = 219.136.241.211
NETMASK = 255.255.255.255.128
GATEWAY = 219.136.241.254
2. Modify the Gateway
Vi/etc/sysconfig/network
NETWORKING = yes
HOSTNAME = Aaron
GATEWAY = 192.168.1.1
3. Modify DNS
[Aeolus @ db etc] $ vi resolv. conf
Nameserver 202.96.128.68
Nameserver 219.136.241.206
4. Restart Network Configuration
/Etc/init. d/network restart
V. Example
1. Modify the IP address
Effective immediately:
# Ifconfig eth0 192.168.0.20 netmask 255.255.255.0
Start effective:
Modify/etc/sysconfig/network-scripts/ifcfg-eth0