1

I followed this link and created few alias ips on my centos 6.5 machine but all these ips belong to same subnet.

What I have:

My machine: eth0, 10.91.56.3

IP Alias1:eth0:1, 10.91.56.4

IP Alias1:eth0:2, 10.91.56.5

IP Alias1:eth0:3, 10.91.56.6

IP Alias1:eth0:4, 10.91.56.7

Now I want to create few more alias ips on my machine but belonging to different subnets.

What I want:

My machine: eth0, 10.91.56.3

IP Alias1:eth0:1, 10.91.56.4

IP Alias1:eth0:2, 10.91.56.5

IP Alias1:eth0:3, 10.91.56.6

IP Alias1:eth0:4, 10.91.56.7

IP Alias1:eth0:5, 10.91.57.4

IP Alias1:eth0:6, 10.91.58.5

IP Alias1:eth0:7, 10.91.59.6

IP Alias1:eth0:8, 10.91.60.7

Output of ip addr show dev eth0:

[root@PythonClient Desktop]# ip addr show dev eth0 2: eth0: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:0c:29:2b:b7:de brd ff:ff:ff:ff:ff:ff inet 10.91.56.3/24 brd 10.91.56.255 scope global eth0 inet 10.91.56.4/24 brd 10.91.56.255 scope global secondary eth0:1 inet 10.91.56.13/24 brd 10.91.56.255 scope global secondary eth0:10 inet 10.91.56.14/24 brd 10.91.56.255 scope global secondary eth0:11 inet 10.91.56.15/24 brd 10.91.56.255 scope global secondary eth0:12 inet 10.91.56.16/24 brd 10.91.56.255 scope global secondary eth0:13 inet 10.91.56.17/24 brd 10.91.56.255 scope global secondary eth0:14 inet 10.91.56.18/24 brd 10.91.56.255 scope global secondary eth0:15 inet 10.91.56.19/24 brd 10.91.56.255 scope global secondary eth0:16 inet 10.91.56.20/24 brd 10.91.56.255 scope global secondary eth0:17 inet 10.91.56.21/24 brd 10.91.56.255 scope global secondary eth0:18 inet 10.91.56.22/24 brd 10.91.56.255 scope global secondary eth0:19 inet 10.91.56.5/24 brd 10.91.56.255 scope global secondary eth0:2 inet 10.91.56.23/24 brd 10.91.56.255 scope global secondary eth0:20 inet 10.91.56.24/24 brd 10.91.56.255 scope global secondary eth0:21 inet 10.91.56.25/24 brd 10.91.56.255 scope global secondary eth0:22 inet 10.91.56.26/24 brd 10.91.56.255 scope global secondary eth0:23 inet 10.91.56.27/24 brd 10.91.56.255 scope global secondary eth0:24 inet 10.91.56.28/24 brd 10.91.56.255 scope global secondary eth0:25 inet 10.91.56.29/24 brd 10.91.56.255 scope global secondary eth0:26 inet 10.91.56.30/24 brd 10.91.56.255 scope global secondary eth0:27 inet 10.91.56.31/24 brd 10.91.56.255 scope global secondary eth0:28 inet 10.91.56.32/24 brd 10.91.56.255 scope global secondary eth0:29 inet 10.91.56.6/24 brd 10.91.56.255 scope global secondary eth0:3 inet 10.91.56.33/24 brd 10.91.56.255 scope global secondary eth0:30 inet 10.91.56.34/24 brd 10.91.56.255 scope global secondary eth0:31 inet 10.91.56.35/24 brd 10.91.56.255 scope global secondary eth0:32 inet 10.91.56.36/24 brd 10.91.56.255 scope global secondary eth0:33 inet 10.91.56.37/24 brd 10.91.56.255 scope global secondary eth0:34 inet 10.91.56.38/24 brd 10.91.56.255 scope global secondary eth0:35 inet 10.91.56.39/24 brd 10.91.56.255 scope global secondary eth0:36 inet 10.91.56.40/24 brd 10.91.56.255 scope global secondary eth0:37 inet 10.91.56.41/24 brd 10.91.56.255 scope global secondary eth0:38 inet 10.91.56.42/24 brd 10.91.56.255 scope global secondary eth0:39 inet 10.91.56.7/24 brd 10.91.56.255 scope global secondary eth0:4 inet 10.91.56.43/24 brd 10.91.56.255 scope global secondary eth0:40 inet 10.91.56.44/24 brd 10.91.56.255 scope global secondary eth0:41 inet 10.91.56.45/24 brd 10.91.56.255 scope global secondary eth0:42 inet 10.91.56.46/24 brd 10.91.56.255 scope global secondary eth0:43 inet 10.91.56.47/24 brd 10.91.56.255 scope global secondary eth0:44 inet 10.91.56.48/24 brd 10.91.56.255 scope global secondary eth0:45 inet 10.91.56.49/24 brd 10.91.56.255 scope global secondary eth0:46 inet 10.91.56.50/24 brd 10.91.56.255 scope global secondary eth0:47 inet 10.91.56.51/24 brd 10.91.56.255 scope global secondary eth0:48 inet 10.91.56.52/24 brd 10.91.56.255 scope global secondary eth0:49 inet 10.91.56.8/24 brd 10.91.56.255 scope global secondary eth0:5 inet 10.91.56.53/24 brd 10.91.56.255 scope global secondary eth0:50 inet 10.91.56.9/24 brd 10.91.56.255 scope global secondary eth0:6 inet 10.91.56.10/24 brd 10.91.56.255 scope global secondary eth0:7 inet 10.91.56.11/24 brd 10.91.56.255 scope global secondary eth0:8 inet 10.91.56.12/24 brd 10.91.56.255 scope global secondary eth0:9 inet6 fe80::20c:29ff:fe2b:b7de/64 scope link valid_lft forever preferred_lft forever

How do I achieve this?

  • Aren't those all in the same subnet (10/8)? – Anthon Apr 2 '15 at 12:06
  • So should I change my netmask from 255.255.255.0 to 255.0.0.0? Then what should my gateway be? My current gateway is 10.91.56.1 – Bhoomika Sheth Apr 2 '15 at 12:09
  • 2
    It depends on what you're trynig to do. You can also just add 10.91.57.4 with a netmask of 255.255.255.0 if you want; whether it'll work in whatever you're trying to achieve can't be said without more detailed information on what that is. – wurtel Apr 2 '15 at 12:16
  • I am trying to develop a traffic generation tool using python where I need more number of clients. So I want to use these ip alias to send http requests. Simply adding IP with netmask 255.255.255.0 does not allow to ping new ip created in this way from my server. Thus generating traffic here becomes impossible in this way. – Bhoomika Sheth Apr 2 '15 at 12:19
  • Not wanting to sound rude, but please can you go back and edit your question to provide us with all the information we might needto answer your question. The output of ip addr show dev eth0 would help. As would the description you've given us in the comment. – roaima Apr 2 '15 at 12:23
0

You are using IP addresses in the reserved IP address range that allows you ~16 million addresses. You can set the the mask to 255.0.0.0 or 255.255.0.0, you don't have to restrict that to 255.255.255.0 if you want more clients on your subnet.

This does not influence what is your gateway, but as that one is not within the range of 10.91.56./24, you should make sure you understand how that gateway is reached, and whether any addresses you add don't conflict with something else in the 10.91.57. range.

  • I tried adding netmask as 255.255.0.0 and adding one more alias as 10.91.57.3 with gateway as 10.91.56.1. But then i am not able to ping ip 10.91.57.3 from my server – Bhoomika Sheth Apr 3 '15 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.