C
C
CarderCC2020-07-21 08:12:18
linux
CarderCC, 2020-07-21 08:12:18

How to bind ip to server?

There is a virtual machine, you need to bind 192.168.0.0/24 to it so that each IP is available on it from 254 pcs, how to do this ifconfig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
unseriously, 2020-07-21
@unseriously

It would be nice to specify the OS, but in general something like this: sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0
https://help.ubuntu.ru/wiki/%D1%80%D1%83%D0%BA%D0% ...

A
Antuan1979, 2020-07-21
@Antuan1979

For Linux:
Edit the /etc/network/interfaces file in any convenient way:
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.42
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:0
allow-hotplug eth0:0
iface eth0: 0 inet static address
192.168.1.43 netmask 255.255.255.0
Reboot
:
/etc/init.d/networking restart
ifconfig eth0 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0 and so on... replace only eth0 with your interface name.
(all input is better done in a loop in a bash script)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question