Results 1 to 4 of 4
Hi all, I want to configure 2 IPs (of diffrent Network like 10.40.60.21/24 and 172.16.16.12/24 with default gatways as 172.16.16.10/32) on Single Network Interface Card. Also then i want to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-11-2012 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 21
configuring 2 IPs on Single Network interface in CentOS 5.8
Hi all, I want to configure 2 IPs (of diffrent Network like 10.40.60.21/24 and 172.16.16.12/24 with default gatways as 172.16.16.10/32) on Single Network Interface Card. Also then i want to modify the default routing on my system. So can anyone help me on this
- 12-11-2012 #2
Hello,
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
Cheers,
Srj
- 12-12-2012 #3Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,745
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:
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!).Code:ip addr add 192.168.1.2/24 dev eth0 ip addr add 10.1.1.2/24 dev eth0
- 12-13-2012 #4Just Joined!
- Join Date
- Mar 2009
- Posts
- 21
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.


Reply With Quote
