H
H
heihachi882014-10-31 15:23:36
Hetzner
heihachi88, 2014-10-31 15:23:36

How to add IPV4 address to Ubuntu server?

Can you please tell me how can I add an additional IPV4 address to a dedicated server that runs on Ubuntu 14.04?

The server is hosted by Hetzner. ifconfig only shows 1 IPV4 address.

UPDATE.

Need an option through editing the file /etc/network/interfaces

/etc/network/interfaces

### Hetzner Online AG - installimage
# Loopback device:
auto lo
iface lo inet loopback

# device: eth0
auto  eth0
iface eth0 inet static
  address   aa.aa.aa.aa
  broadcast bb.bb.bb.bb
  netmask   cc.cc.cc.cc
  gateway   dd.dd.dd.dd
  # default route to access subnet
  up route add -net dd.dd.dd.dd netmask cc.cc.cc.cc gw dd.dd.dd.dd eth0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-10-31
@bk0011m

It is necessary to add it with an alias.
Let's say you have an interface eth0
then like this:
Again, if this is an address from the same network. If not, then you need to raise another interface.

I
Ivan, 2014-10-31
@LiguidCool

If I remember correctly, it is added using the same technology:

auto eth0
iface eth0 inet static
    address 192.168.1.42
    netmask 255.255.255.0
    gateway 192.168.1.1

auto eth0:0
iface eth0:0 inet static
    address 192.168.1.43
    netmask 255.255.255.0

auto eth0:1
iface eth0:1 inet static
    address 192.168.1.44
    netmask 255.255.255.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question