Configurare retea debian cu mai multe ipuri

Important Notes:
1.) Before making any changes to your network configuration, please make sure you obtain any relevant information such as Gateway, Subnet and allocated IP Block details to ensure no mistakes are made!
2.) Make a backup of your existing configuration in case you need to fall back to this at a later stage: sudo cp /etc/network/interfaces /etc/network/interfaces_backup

Now edit it’s time to edit your configuration: sudo vi /etc/network/interfaces

We’re only interested in updating the “eth” part of the configuration so ignore the loopback section if present.

Rearrange your existing configuration to look as follows (feel free to remove the broadcast and network entries):

auto eth0

iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.248
gateway 192.168.1.254

Now add your new entries so the finish configuration looks like:

auto eth0
auto eth0:0
auto eth0:1

iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.248
gateway 192.168.1.254

iface eth0:0 inet static
address 192.168.1.2
netmask 255.255.255.248
gateway 192.168.1.254

iface eth0:1 inet static
address 192.168.1.3
netmask 255.255.255.248
gateway 192.168.1.254

You should be able to see a pattern emerging, keep adding new entires as necessary!

Once you have finished adding your IPs you can save and close the file and finally, for the new changes to take effect, issue: /etc/init.d/networking restart
Add to Favourites Add to Favourites

Lasă un răspuns

Acest site folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.