S
S
Salavat Sharapov2014-03-19 14:14:23
Debian
Salavat Sharapov, 2014-03-19 14:14:23

Add additional IP address to physical card on Debian 7?

1) Ifconfig eth0:1 10.10.10.10 - Wirth map is created, but after reboot it is naturally demolished.
2) When added to the interface, just
iface eth0:1 inet static
address 10.10.10.10
netmask 255.0.0.0
it does not get up either
3) When added to rc.local /sbin/ifconfig eth0:1 10.10.10.10 - it does not get up either.
Skis go *(

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2014-03-19
@desperadik

This is not a virtual card, but an additional IP. You only see it as just another interface because of the limitations of the OBSOLETE ifconfig utility.
Here is an example:

# Это вывод команды ip a
# Как видите сетевому интерфейсу просто назначили дополнительный IP
[email protected]:~$ ip a
...

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether f6:8e:be:42:fe:45 brd ff:ff:ff:ff:ff:ff
    inet 192.168.20.117/22 brd 192.168.23.255 scope global eth1
    inet 10.10.10.10/8 brd 10.255.255.255 scope global eth1:1
    inet6 fe80::f48e:beff:fe42:fe45/64 scope link
       valid_lft forever preferred_lft forever

# А это вывод команды ifconfig
# Она не знает ничего о дополнительных IP, так как была написана в те 
# времена, когда о дополнительных IP речи не шло, поэтому
# дополнительный IP она показывает как ещё один сетевой интерфейс 
[email protected]:~$ ifconfig
...
eth1      Link encap:Ethernet  HWaddr f6:8e:be:42:fe:45
          inet addr:192.168.20.117  Bcast:192.168.23.255  Mask:255.255.252.0
          inet6 addr: fe80::f48e:beff:fe42:fe45/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12360527 errors:0 dropped:4 overruns:0 frame:0
          TX packets:463990 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:793403845 (793.4 MB)  TX bytes:77757263 (77.7 MB)
          Interrupt:27

eth1:1    Link encap:Ethernet  HWaddr f6:8e:be:42:fe:45
          inet addr:10.10.10.10  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:27

This is how it should work:
auto eth0:0
iface eth0:0 inet static
    address 23.99.99.100
    netmask 255.255.255.0

V
Vlad Zhivotnev, 2014-03-19
@inkvizitor68sl

Add to the main interface
And I don't think the mask 255.0.0.0 is correct ;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question