Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    configuring 2 IPs on Single Network interface in CentOS 5.8

    Hi all, I want to configure 2 IPs (of diffrent Network like and with default gatways as on Single Network Interface Card. Also then i want to modify the default routing on my system. So can anyone help me on this

  2. #2
    Just Joined! srj's Avatar
    Join Date
    Jan 2012

    One sollution using the "ifconfig" command:

    ifconfig eth0:1 <new_ip> netmask <new_netmask>

    This will create a virtual network eth0:1 with the new desired settings.

    To make this network available after every restart you will need to change some configuration files. I hope this guide will help you with this: Chapter*13.*Network Interfaces


  3. #3
    I prefer to use ip (from the iproute package) as it is more capable than ifconfig, and is slowly replacing ifconfig everywhere. here is an example of usage:

    ip addr add dev eth0
    ip addr add dev eth0
    if you really want, you can assign aliases to them (like eth0:0) if you want, but I find those confusing (and iptables doesn't like them!).

  4. $spacer_open
  5. #4

    how to change IP addr, and change the default routing

    Thanku guys for your response, but i have a few questions, that i want to change the IP add of my interface regularly, as my connection to internet is through proxy, and to access net i have to change my IP.
    And next thing is with 2 IPs configured, and one default gateway, i have to add routes so that packets for local network send on another gateway and all other packets are send on default gateway, so how to configure that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts