# "/etc/conf.d/net" with virt. IP's does not apply them, why?

## qeldroma

Hello again,

i've got a simple straightforward config for network:

```
# cat /etc/conf.d/net

config_eth0=(   "212.86.41.30/24"

                "212.86.41.204/24"

                "212.86.41.205/24" )

routes_eth0=( "default via 212.86.41.1" )

dns_servers_eth0="212.86.32.2"
```

While (re)starting, i get [OK] on all three IP's, as if it would apply them correctly:

```
INIT: Entering runlevel: 3

 * Starting eth0

 *   Bringing up eth0

 *     212.86.41.30/24                    [ ok ]

 *     212.86.41.204/24                    [ ok ]

 *     212.86.41.205/24                    [ ok ]

 *   Adding routes

 *     default via 212.86.41.1 ...                    [ ok ]

```

But, ifconfig doesn't list any virtual IPs. Only the physical one?!

```
# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:XX:XX:XX:XX:XX

          inet addr:212.86.41.30  Bcast:212.86.41.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2724 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2558 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:1064793 (1.0 MiB)  TX bytes:746235 (728.7 KiB)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:16 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1042 (1.0 KiB)  TX bytes:1042 (1.0 KiB)
```

What do i have to do to get this working?

Kind regards, Florian

----------

## malern

Do you have sys-apps/iproute2 installed? If you do then the network scripts use that to setup your aliased IP addresses, but they do it in such a way that ifconfig can't see them.

Try running 

```
ip addr
```

and see if they are listed.

----------

## qeldroma

# ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000

    link/ether 00:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff

    inet 212.86.41.30/24 brd 212.86.41.255 scope global eth0

    inet 212.86.41.204/24 brd 212.86.41.255 scope global secondary eth0

    inet 212.86.41.205/24 brd 212.86.41.255 scope global secondary eth0

Any idea why ifconfig doesn't list them?

However i can ping them...

Greets, Florian

----------

## !what-ever!

sorry dont know  :Confused: 

----------

## malern

Basically ifconfig is old and has been deprecated by iproute2. iproute2 can do everything ifconfig can do, and a whole lot more.

iproute2 can add multiple ip addresses to an interface without having to create new names for each one. Which is something ifconfig can't do and doesn't understand, and therefore it can't show them.

If you really want to stick with ifconfig then you can add the following line to /etc/conf.d/net

modules=( "ifconfig" )

----------

## qeldroma

So it's not a bug, it's a feature  :Wink: 

Nice to know, though..

Thanks, now i need to learn iproute for future...Last edited by qeldroma on Tue Jun 02, 2009 2:14 pm; edited 1 time in total

----------

## qeldroma

Hmmm....

There must be something missing:

I can ping it locally, but not from external IPs in the same subnet.

Is there something i'ld have to add?

Although the arp-cache on the directly connected switch is resetted, the switch couldn't reach/find the ip.

any deas?

----------

