# Invisible IP addresses?

## StoneC0ld

I've got a server on gentoo 2006.1 using kernel 2.6.18-hardened... 

I've got about 20 ip aliases configured on the server, and all appear to work.  However, only eth0 shows up in "ifconfig".....

Is there something new in this kernel that hides ip addresses in ifconfig results?  Or is this server just really messed up?

----------

## hoka

Try "ip address show"

----------

## StoneC0ld

Works, shows the ip's.... But, is this normal for grsecurity-enabled 2.6.18-hardened?

----------

## vibrokatana

Normally ifconfig only lists the active devices (ie up, not down) unless you use ifconfig -a

----------

## GNUtoo

cat /proc/net/dev/ list all devices even thoses who are down

----------

## DNAspark99

I've noticed this behavior too... if you add aliases 'the gentoo way' in /etc/conf.d/net, they won't show up using 'ifconfig'... but if you add them by hand (ifconfig eth0:X xxx.xxx.xxx.xxx ...) they DO show up. I think the 'gentoo way' is adding them another way, and for some reason ifconfig isn't able to list them...

----------

## xces

ifconfig can only show one IP address per interface. To show all IP addresses in ifconfig, you'd have to create an alias interface (eth0:X) for each IP address.

The modern way[tm] to set up more than one IP address is by using ip (from iproute2), which can handle multiple IP addresses per interface.

ifconfig is obsolete...

----------

## GNUtoo

where can i find SIMPLE info about BASIC commands for iproute2?

mabe in a GWN?

----------

## desultory

Try the Linux Advanced Routing & Traffic Control HOWTO.

----------

## xces

 *GNUtoo wrote:*   

> where can i find SIMPLE info about BASIC commands for iproute2?

 

http://www.policyrouting.org/iproute2.doc.html

----------

## DNAspark99

Can someone give me the exact syntax required for adding new 'aliases'? I've got a production machine here with a bunch of existing aliases configured in /etc/conf.d/net, and now must add some more IPs, which will also be aliased, and I'd really like to avoid restarting the machine/service. 

the 'old way' was as simple as:

```
 ifconfig eth0:X 10.100.100.1 netmask 255.255.255.0
```

Is the 'NEW way' as simple as:

```
ip addr add 10.100.100.1/24 dev eth0 brd 10.100.100.255
```

 ?

----------

