Linux configuration multiple IP

  
        

Here is Red Hat Linux as an example. Assume that the original system has been configured with an IP address of 192.168.20.140 and the configuration file path /etc/sysconfig/network-script/ifcfg-eth0. Now you need to configure an IP with a network segment of 192.168.1.

Step (requires root user authority):

1, cp /etc/sysconfig/network-script/ifcfg-eth0 /etc/sysconfig/network-script/ifcfg-eth1

2, vi /etc/sysconfig/network-script/ifcfg-eth1 modify the boldface part, colon plus 1

DEVICE=eth0:1 BOOTPROTO=none ONBOOT=yes HWADDR=00:0c:29 :ee:a6:11 NETMASK=255.255.255.0 IPADDR=192.168.1.140 TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes

3, service network restart Make modified configuration take effect

4 View through ifconfig, then see an additional eth1 IP configuration

Reference: http://world77.blog.51cto.com/414605/368529

Copyright © Windows knowledge All Rights Reserved