Results 1 to 2 of 2
Hi,
I'm wondering if its possble to alias an entire subnet in one hit rather than doing individual IP's with:
ifconfig eth0:1 1.2.3.4
ifconfig eth0:2 1.2.3.5
.
ifconfig eth0:50 1.2.3.54
...
- 06-19-2008 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 2
Multiple interface aliases - entire subnet
Hi,
I'm wondering if its possble to alias an entire subnet in one hit rather than doing individual IP's with:
ifconfig eth0:1 1.2.3.4
ifconfig eth0:2 1.2.3.5
.
ifconfig eth0:50 1.2.3.54
I'm wanting to alias an entire /21 subnet so doing it this way isnt practical and maybe not even possible (is there a limit on how many aliases you can have?).
I thought maybe this is possible with ip route or similar.
Any help would be appreciated,
Rob.
- 06-19-2008 #2Just Joined!
- Join Date
- Jun 2008
- Posts
- 2
#! /bin/bash
for NUM in $(seq 1 255);
do
ip addr add 1.2.3.$NUM/21 broadcast + dev eth0
done
Nest for loops for modifying the preceding octets


Reply With Quote
