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

    Multiple interface aliases - entire subnet

    I'm wondering if its possble to alias an entire subnet in one hit rather than doing individual IP's with:

    ifconfig eth0:1
    ifconfig eth0:2
    ifconfig eth0:50

    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,

  2. #2
    #! /bin/bash

    for NUM in $(seq 1 255);
    ip addr add 1.2.3.$NUM/21 broadcast + dev eth0

    Nest for loops for modifying the preceding octets

Posting Permissions

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