• Privacy Policy
  • Disclaimer
  • Sitemap
  • contact

netlabinfo

share for better life

  • Home
  • UBUNTU
  • GUIDE
  • DEBIAN
  • SECURITY
  • CENTOS
  • TIPS
  • CISCO
Home » CENTOS » CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK INTERFACE ON CENTOS

CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK INTERFACE ON CENTOS

ripper_id
1 Comment
CENTOS
Sunday, November 20, 2016
how to configure multiple address on a single network interface with virtual network interface on centos
Configure multiple ip address on a single NIC is possible with virtual network interfaces. as the name sugest, the ip is configured virtually. Usually virtual network interface is used for configuring multiple website with different ip address on a single web server, also you can manage or classification your local network with virtual network interface for security, maintenance, and troubleshooting purpose. The main advantages is, you can configure multiple ip address in a single NIC.  Here step by step to configure virtual network interface.

Go to default directory of network interface.
# cd /etc/sysconfig/network-scripts/
if you type “ls” command you will see the following files
ifcfg-eth0  ifdown-isdn   ifup-aliases ifup-plusb  init.ipv6-global
ifcfg-lo    ifdown-post   ifup-bnep    ifup-post   net.hotplug
ifdown      ifdown-ppp    ifup-eth     ifup-ppp    network-functions
ifdown-bnep ifdown-routes ifup-ippp    ifup-routes network-functions-ipv6
ifdown-eth  ifdown-sit    ifup-ipv6    ifup-sit
ifdown-ippp ifdown-tunnel ifup-isdn    ifup-tunnel
ifdown-ipv6 ifup          ifup-plip    ifup-wireless
the network interfaces files is called ifcfg-eth0.

Now in this tutorial, we will create 2 virtual network interface. The configuration will be like this
Physical network interfaces
Virtual network interface 1
Virtual network interface 2
IP           : 192.168.43.2
Netmask : 255.255.255.0
Gateway : 192.168.43.1

IP           : 192.168.43.3
Netmask           : 255.255.255.0
Gateway           : 192.168.43.1

IP           : 192.168.43.4
Netmask : 255.255.255.0
Gateway : 192.168.43.1

Copy the network interface file
# cp ifcfg-eth0 ifcfg-eth0:0
# cp ifcfg-eth0 ifcfg-eth0:1
Ifcfg-eth0:0 and ifcfg-eth0:1 will be our virtual network interface file.  

Open the virtual network interface files with nano editor
# nano ifcfg-eth0:0 ifcfg-eth0 ifcfg-eth0:1

Configuration the files similar to below
Eth0:0
DEVICE=eth0:0
HWADDR=00:0C:29:AA:79:28
TYPE=Ethernet
UUID=6b1c6abc-ecfe-4e91-832d-8a4ce3ea45c1
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.43.3
NETMASK=255.255.255.0
GATEWAY=192.168.43.1

Eth0:1
DEVICE=eth0:1
HWADDR=00:0C:29:AA:79:28
TYPE=Ethernet
UUID=6b1c6abc-ecfe-4e91-832d-8a4ce3ea45c1
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.43.4
NETMASK=255.255.255.0
GATEWAY=192.168.43.1

After that exit and save. Restart virtual network interface
/etc/init.d/network restart
To verify your configuration, use command
ifconfig
if your configuration success, you will see something similar like this in your terminal
eth0      Link encap:Ethernet  HWaddr 00:0C:29:AA:79:28  
          inet addr:192.168.43.248  Bcast:192.168.43.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feaa:7928/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1159 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1061 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:126925 (123.9 KiB)  TX bytes:132598 (129.4 KiB)
          Interrupt:19 Base address:0x2000 

eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:AA:79:28  
          inet addr:192.168.43.3  Bcast:192.168.43.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:19 Base address:0x2000 

eth0:1    Link encap:Ethernet  HWaddr 00:0C:29:AA:79:28  
          inet addr:192.168.43.4  Bcast:192.168.43.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          Interrupt:19 Base address:0x2000 
Tweet
CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK INTERFACE ON CENTOS Title : CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK INTERFACE ON CENTOS
Description : Configure multiple ip address on a single NIC is possible with virtual network interfaces. as the name sugest, the ip is configured virt...
Rating : 5

1 Response to "CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK INTERFACE ON CENTOS"

  1. MiaDecember 1, 2017 at 7:28 AM

    In the event that each address were special, all switches on the web would need to store the address of every last machine on the web. myip location

    ReplyDelete
    Replies
      Reply
Add comment
Load more...

← Newer Post Older Post → Home
Subscribe to: Post Comments (Atom)

FOLLOW US

POPULAR POST

  • BASIC NMAP COMMAND FOR NETWORK ADMINISTRATOR
    Nmap is an open source that usually used by network administrator or pentester to scanning network for security and maintenance purpose. ...
  • CONFIGURE AUTHORITATIVE DNS SERVER (MASTER + SLAVE) WITH BIND ON DEBIAN
    DNS server is very usefull when we access any website on the internet. The usability is providing an correct ip address of website or ho...
  • HARDENING SERVER TIPS
    hardening server is a proces securing server. this is an important thing to do remembering how many server is attacked by  hackers. we...
  • CONFIGURE BRIDGED NETWORK ON VMWARE
    VMware is a powerful software that provide you an virtualization enviroment, Usually VMware used for education purpose, so you can try ma...
  • FTP COMMAND LIST WITH TIPS HOW TO USE IT EFFECTIVELY
    ftp is an network protocol that handle transfer data between computer  and use client server architecture. Usually many people connec...
  • INSTALL LAMP IN UBUNTU SERVER 16.04
    LAMP is a open sources packet software that use for building a powerfull web server.  lamp is consist of LINUX operating system, apache w...
  • CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK INTERFACE ON CENTOS
    Configure multiple ip address on a single NIC is possible with virtual network interfaces. as the name sugest, the ip is configured virt...

Blog Archive

  • ►  2017 (2)
    • ►  February (1)
    • ►  January (1)
  • ▼  2016 (5)
    • ►  December (1)
    • ▼  November (2)
      • FTP COMMAND LIST WITH TIPS HOW TO USE IT EFFECTIVELY
      • CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK...
    • ►  July (2)

Labels

  • CENTOS
  • COMMAND
  • DEBIAN
  • GUIDE
  • SECURITY
  • TIPS
  • UBUNTU

Blog Archive

  • ►  2017 (2)
    • ►  February (1)
    • ►  January (1)
  • ▼  2016 (5)
    • ►  December (1)
    • ▼  November (2)
      • FTP COMMAND LIST WITH TIPS HOW TO USE IT EFFECTIVELY
      • CONFIGURE MULTIPLE IP ADDRESS WITH VIRTUAL NETWORK...
    • ►  July (2)
Back to top!
Copyright 2014 netlabinfo - All Rights Reserved Design by Ciri seo - Powered by Blogger