How to add multiple ip addresses online in Linux

Source: Internet
Author: User
How to add multiple ip addresses online in a Linux system-Linux Enterprise Application-Linux server application information. To add multiple ip addresses online in Linux, you must first view the ip addresses.
Linuxedu.net # ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 50: BA: EF: 21: E2
Inet addr: 192.168.1.1 Bcast: 192.168.1.255 mask: 255.255.255.0
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 3433865 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2730922 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 100
RX bytes: 2610363482 (2489.4 Mb) TX bytes: 577832769 (551.0 Mb)
Interrupt: 11 Base address: 0xc000
Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 811139 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 811139 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 2007636558 (1914.6 Mb) TX bytes: 2007636558 (1914.6 Mb)
Add ip
Ifconfig eth0: 0 192.168.1.2 netmask 255.255.255.255 up
In view.
Linuxedu.net # ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 50: BA: EF: 21: E2
Inet addr: 192.168.1.1 Bcast: 192.168.1.255 Mask: 255.255.255.0
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 3433865 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2730922 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 100
RX bytes: 2610363482 (2489.4 Mb) TX bytes: 577832769 (551.0 Mb)
Interrupt: 11 Base address: 0xc000
Eth0: 0 Link encap: Ethernet HWaddr 00: 50: BA: EF: 21: E2
Inet addr: 192.168.1.2 Bcast: 192.168.1.255 Mask: 255.255.255.255
Up broadcast running multicast mtu: 1500 Metric: 1
RX packets: 3433471 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2730637 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 100
RX bytes: 2610321034 (2489.3 Mb) TX bytes: 577696691 (550.9 Mb)
Interrupt: 11 Base address: 0xc000
Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Up loopback running mtu: 16436 Metric: 1
RX packets: 811139 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 811139 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 2007636558 (1914.6 Mb) TX bytes: 2007636558 (1914.6 Mb)
Finally, it is written to the file to take effect upon restart.
Vi/etc/sysconfig/network-scripts/ifcfg-eth0: 0
DEVICE = eth0: 0
ONBOOT = yes
BOOTPROTO = static
IPADDR = 192.168.1.2
Remove ip
Ifconfig eth0: 0 192.168.1.2 netmask 255.255.255.255 down
Rm/etc/sysconfig/network-scripts/ifcfg-eth0: 0
Complete

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.