eth3<\/span><\/code><\/pre>\n\n\n\n5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000\n link\/ether 6e:d7:1b:bf:3b:cf brd ff:ff:ff:ff:ff:ff\n altname enp0s5\n altname ens5\n inet 94.237.59.222\/22 metric 100 brd 94.237.59.255 scope global dynamic eth2\n valid_lft 86396sec preferred_lft 86396sec\n inet6 fe80::6cd7:1bff:febf:3bcf\/64 scope link \n valid_lft forever preferred_lft forever<\/pre>\n\n\n\nOnce you see the new interface at the end of the list like in the example above you\u2019ve successfully configured a new IP address to your Cloud Server. It can now be used to connect to the host just like the other addresses.<\/p>\n\n\n\n
Debian and Ubuntu 20 or earlier<\/h2>\n\n\n\n
Connect to your Cloud Server. Once in, you\u2019ll need to add a new interface configuration to the \/etc\/network\/interfaces<\/tt> file. Open it for editing with elevated privileges.<\/p>\n\n\n\nsudo nano \/etc\/network\/interfaces<\/code><\/pre>\n\n\n\nThen enter one of the examples underneath the end of the file. The number of the network interface needs to be unique, set it to one larger than the previous one. If you haven\u2019t added addresses before it should be eth3<\/em> like in the example here.<\/p>\n\n\n\nauto eth3\niface eth3 inet dhcp<\/code><\/pre>\n\n\n\nIn the case of IPv6 the syntax is a little different, use the following instead.<\/p>\n\n\n\n
auto eth3\niface eth3 inet6 auto<\/code><\/pre>\n\n\n\nThen save the file and exit the editor.<\/p>\n\n\n\n
Afterwards, you\u2019ll need to restart the network to have the changes take effect.<\/p>\n\n\n\n
sudo systemctl restart networking<\/code><\/pre>\n\n\n\nCheck that the new interface appears and shows the correct new IP address with the following command.<\/p>\n\n\n\n
ip addr<\/code><\/pre>\n\n\n\nIf the IP addresses are not working after this, add the following lines to \/etc\/sysctl.conf<\/tt>:<\/p>\n\n\n\nsudo nano \/etc\/sysctl.conf<\/code><\/pre>\n\n\n\nnet.ipv4.conf.all.rp_filter=0\nnet.ipv4.conf.default.rp_filter=0\nnet.ipv4.ip_forward = 1<\/code><\/pre>\n\n\n\nOn Ubuntu, you might also need to add the following to the specific new network interface and replace the number on the lines as appropriate.<\/p>\n\n\n\n
net.ipv4.conf.eth3<\/span>.rp_filter = 2\nnet.ipv4.conf.eth3<\/span>.arp_filter = 1<\/pre>\n\n\n\nOnce you\u2019ve saved the sysctl.conf<\/tt>, update the system status.<\/p>\n\n\n\nsudo sysctl -p<\/code><\/pre>\n\n\n\nThen restart the network using the same command as above and check the IP addresses again.<\/p>\n\n\n\n
sudo systemctl restart networking<\/code><\/pre>\n\n\n\nip addr<\/code><\/pre>\n\n\n\n5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\n link\/ether 6e:d7:1b:bf:63:c8 brd ff:ff:ff:ff:ff:ff\n inet 185.26.50.223\/22 brd 185.26.51.255 scope global eth3\n valid_lft forever preferred_lft forever\n inet6 fe80::6cd7:1bff:febf:63c8\/64 scope link\n valid_lft forever preferred_lft forever<\/pre>\n\n\n\nOnce you see the new interface at the end of the list like in the example above you\u2019ve successfully configured a new IP address to your Cloud Server. It can now be used to connect to the host just like the other addresses.<\/p>\n\n\n\n
If you have problems reaching one of the IP addresses with ping<\/tt>, for example, try rebooting the server and testing the connection again.<\/p>\n\n\n\nsudo reboot<\/code><\/pre>\n\n\n\nAlso, make sure your firewall settings allow connecting to the new IP address as well.<\/p>\n\n\n\n
CentOS<\/h2>\n\n\n\n
You\u2019ll need to create a new network interface configuration file in the \/etc\/sysconfig\/network-scripts<\/tt> folder. Copy one of the pre-existing files to have a starting point, for example, the ifcfg-eth0<\/span><\/tt> to ifcfg-eth3<\/span><\/tt> with the following command.<\/p>\n\n\n\nsudo cp \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/span> \/etc\/sysconfig\/network-scripts\/ifcfg-eth3<\/span><\/code><\/pre>\n\n\n\nThen open the new file and change it to suit the new interface. Replace the device number on the first line with a new higher number. Commonly it would be eth3<\/tt> like in the example below if this is the first address you are adding after deploying the cloud server.<\/p>\n\n\n\nDEVICE=eth3\nBOOTPROTO=dhcp\nONBOOT=yes<\/code><\/pre>\n\n\n\nIf you are attaching an IPv6 address, you can copy the existing IPv6 configuration.<\/p>\n\n\n\n
sudo cp \/etc\/sysconfig\/network-scripts\/ifcfg-eth2<\/span> \/etc\/sysconfig\/network-scripts\/ifcfg-eth3<\/span><\/code><\/pre>\n\n\n\nThen change the device name, for example as below.<\/p>\n\n\n\n
DEVICE=eth3\nNM_CONTROLLED=no\nIPV6INIT=yes<\/code><\/pre>\n\n\n\nCheck your \/etc\/sysctl.conf<\/tt>, and make sure the default rp_filter<\/tt> is set to 0.<\/p>\n\n\n\nsudo sysctl -a | grep default.rp_filter<\/code><\/pre>\n\n\n\nIf not, open the file to edit and add the parameter to the end of the file.<\/p>\n\n\n\n
net.ipv4.conf.default.rp_filter = 0<\/code><\/pre>\n\n\n\nIf you made changes to the sysctl.conf<\/tt>, update the system.<\/p>\n\n\n\nsudo sysctl -p<\/code><\/pre>\n\n\n\nUse the following command after you have done these operations to restart the network.<\/p>\n\n\n\n
sudo systemctl restart network<\/code><\/pre>\n\n\n\nThen check the IP configuration.<\/p>\n\n\n\n
ip addr<\/code><\/pre>\n\n\n\n5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000\n link\/ether 6e:d7:1b:bf:49:64 brd ff:ff:ff:ff:ff:ff\n inet 185.20.138.90\/22 brd 185.20.139.255 scope global dynamic eth3\n valid_lft 86189sec preferred_lft 86189sec\n inet6 fe80::6cd7:1bff:febf:4964\/64 scope link\n valid_lft forever preferred_lft forever<\/pre>\n\n\n\nWhen you see the new IP address in the command output it\u2019s connected and ready to use.<\/p>\n\n\n\n
If you have problems reaching one of the IP addresses with ping<\/tt>, for example, try rebooting the server and testing the connection again.<\/p>\n\n\n\nsudo reboot<\/code><\/pre>\n\n\n\nAlso, make sure your firewall settings allow connecting to the new IP address as well.<\/p>\n\n\n\n
Windows<\/h2>\n\n\n\n
New network interfaces for IPv4 addresses should show up automatically without manual configuration.<\/p>\n\n\n\n
In the case of IPv6, you will need to run a couple of commands via Command Prompt<\/em> with Administrator privilege. Open the program by typing cmd<\/em> in the Run window and press enter, then copy in the commands below.<\/p>\n\n\n\nnetsh interface ipv6 set global randomizeidentifiers=disabled store=active \nnetsh interface ipv6 set global randomizeidentifiers=disabled store=persistent \nnetsh interface ipv6 set privacy state=disabled store=active \nnetsh interface ipv6 set privacy state=disabled store=persistent<\/code><\/pre>\n\n\n\nAfterwards, you should restart the new network interface by disabling and re-enabling it at the Network Connections window.<\/p>\n\n\n\n
Note that the Windows Server firewall blocks ICMP requests by default. If you want to test the new interface with ping, open the firewall settings with wf.msc<\/tt> in the run window. Find the ICMPv4 and ICMPv6 protocols in the Inbound Rules and enable the ones you need.<\/p>\n\n\n\nOther options<\/h2>\n\n\n\n
It\u2019s also possible to manually set additional public IPv4 addresses to the primary interface, for example creating aliases like eth0:1, and eth0:2 on Linux, by using static configuration. Currently, this is not supported with IPv6 addresses. You can find instructions for setting up alias addresses in our articles for configuring floating IPs on CentOS<\/a>, Debian<\/a>, Ubuntu<\/a> or Windows<\/a>.<\/p>\n","protected":false},"featured_media":27207,"comment_status":"open","ping_status":"closed","template":"","community-category":[108,109,111],"class_list":["post-24338","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","community-category-quick-start","community-category-upcloud-services","community-category-networking"],"acf":[],"_links":{"self":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial\/24338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/types\/tutorial"}],"replies":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/comments?post=24338"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media\/27207"}],"wp:attachment":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media?parent=24338"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/community-category?post=24338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}