Re: iproute2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Mi, den 08.12.2004 schrieb Mezei Zoltan um 21:23:

> I would like to use a network card with 2 IP addresses assigned like:
> ip addr add 10.0.2.1 dev eth0
> ip addr add 192.168.2.1 dev eth0
> How do I do it with the fedora network scripts in /etc/sysconfig/net*? 
> Or should I use a custom init script?

> Zizi

I guess you want to use iproute2 instead of creating an alias device. On
1 host I have a /27 net and so I added some code to /sbin/ifup:

    if [ ${DEVICE} = "eth0" ]; then
         for i in `seq 195 222`; do
            ip addr add xxx.yyy.zzz.$i/27 brd xxx.yyy.zzz.www dev eth0
label eth0
         done
    fi

(FC1, script line 362ff.)

For you no loop is needed:

    if [ ${DEVICE} = "eth0" ]; then
	ip addr add 192.168.2.1 dev eth0
    fi

Not the best way to change system scripts which may be overridden next
update of initscripts rpm i.e. But actually there is no mechanism to use
iproute2 style in existing configuration files.

Alexander


-- 
Alexander Dalloz | Enger, Germany | new address - new key: 0xB366A773
legal statement: http://www.uni-x.org/legal.html
Fedora GNU/Linux Core 2 (Tettnang) on Athlon kernel 2.6.9-1.6_FC2smp 
Serendipity 21:34:56 up 2 days, 20:57, load average: 0.53, 0.50, 0.56 

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux