12.04 Server Multiple IP Addresses with Multiple Interfaces












1















I'm running Ubuntu 12.04 Server on VirtualBox. I'm trying to setup two interfaces with static IP addresses. If I only attach one network interface then eth0 works fine, but once I attach my second interface, eth0 doesn't work but eth1 does. I'm doing this because eth0 is my management subnet and eth1 is my admin/employee subnet. Below is how I've configured the /etc/network/interfaces file. Any help would be greatly appreciate. Thanks.



# This file describes the network interfaces available on your system
# and how to active them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
gateway 10.192.168.1
network 10.192.168.0
broadcast 10.192.169.255
dns-nameserver 192.168.1.21

# The secondary network interface
auto eth1
iface eth1 inet static
address 192.168.0.11
netmask 255.255.248.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.7.255
dns-nameserver 192.168.1.21









share|improve this question


















  • 1





    Problem maybe occur because when you bring up eth1 you add again default gw and change routing. If you do not use network on eth0 to route traffic to internet or another lan network you can configure them without gw. Meybe solve problem.

    – 2707974
    Mar 26 '14 at 13:57











  • yes, you cannot configure two default gateways. Have a look at route and consider what interface should go to external networks, if any. If your eth0 works as intended, you should drop the gateway in eth1. edit: sorry this was meant as comment - not answer

    – benjaminR
    Mar 26 '14 at 14:20











  • I dropped the gateway from eth1, then restarted the network service. Same issue continues to occur. The odd thing is that when I restarted the network service, it says "failed to bring up eth1" but eth1 is the only one working.

    – user3070876
    Mar 26 '14 at 14:25
















1















I'm running Ubuntu 12.04 Server on VirtualBox. I'm trying to setup two interfaces with static IP addresses. If I only attach one network interface then eth0 works fine, but once I attach my second interface, eth0 doesn't work but eth1 does. I'm doing this because eth0 is my management subnet and eth1 is my admin/employee subnet. Below is how I've configured the /etc/network/interfaces file. Any help would be greatly appreciate. Thanks.



# This file describes the network interfaces available on your system
# and how to active them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
gateway 10.192.168.1
network 10.192.168.0
broadcast 10.192.169.255
dns-nameserver 192.168.1.21

# The secondary network interface
auto eth1
iface eth1 inet static
address 192.168.0.11
netmask 255.255.248.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.7.255
dns-nameserver 192.168.1.21









share|improve this question


















  • 1





    Problem maybe occur because when you bring up eth1 you add again default gw and change routing. If you do not use network on eth0 to route traffic to internet or another lan network you can configure them without gw. Meybe solve problem.

    – 2707974
    Mar 26 '14 at 13:57











  • yes, you cannot configure two default gateways. Have a look at route and consider what interface should go to external networks, if any. If your eth0 works as intended, you should drop the gateway in eth1. edit: sorry this was meant as comment - not answer

    – benjaminR
    Mar 26 '14 at 14:20











  • I dropped the gateway from eth1, then restarted the network service. Same issue continues to occur. The odd thing is that when I restarted the network service, it says "failed to bring up eth1" but eth1 is the only one working.

    – user3070876
    Mar 26 '14 at 14:25














1












1








1








I'm running Ubuntu 12.04 Server on VirtualBox. I'm trying to setup two interfaces with static IP addresses. If I only attach one network interface then eth0 works fine, but once I attach my second interface, eth0 doesn't work but eth1 does. I'm doing this because eth0 is my management subnet and eth1 is my admin/employee subnet. Below is how I've configured the /etc/network/interfaces file. Any help would be greatly appreciate. Thanks.



# This file describes the network interfaces available on your system
# and how to active them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
gateway 10.192.168.1
network 10.192.168.0
broadcast 10.192.169.255
dns-nameserver 192.168.1.21

# The secondary network interface
auto eth1
iface eth1 inet static
address 192.168.0.11
netmask 255.255.248.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.7.255
dns-nameserver 192.168.1.21









share|improve this question














I'm running Ubuntu 12.04 Server on VirtualBox. I'm trying to setup two interfaces with static IP addresses. If I only attach one network interface then eth0 works fine, but once I attach my second interface, eth0 doesn't work but eth1 does. I'm doing this because eth0 is my management subnet and eth1 is my admin/employee subnet. Below is how I've configured the /etc/network/interfaces file. Any help would be greatly appreciate. Thanks.



# This file describes the network interfaces available on your system
# and how to active them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
gateway 10.192.168.1
network 10.192.168.0
broadcast 10.192.169.255
dns-nameserver 192.168.1.21

# The secondary network interface
auto eth1
iface eth1 inet static
address 192.168.0.11
netmask 255.255.248.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.7.255
dns-nameserver 192.168.1.21






networking server virtualbox






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 '14 at 13:41









user3070876user3070876

612




612








  • 1





    Problem maybe occur because when you bring up eth1 you add again default gw and change routing. If you do not use network on eth0 to route traffic to internet or another lan network you can configure them without gw. Meybe solve problem.

    – 2707974
    Mar 26 '14 at 13:57











  • yes, you cannot configure two default gateways. Have a look at route and consider what interface should go to external networks, if any. If your eth0 works as intended, you should drop the gateway in eth1. edit: sorry this was meant as comment - not answer

    – benjaminR
    Mar 26 '14 at 14:20











  • I dropped the gateway from eth1, then restarted the network service. Same issue continues to occur. The odd thing is that when I restarted the network service, it says "failed to bring up eth1" but eth1 is the only one working.

    – user3070876
    Mar 26 '14 at 14:25














  • 1





    Problem maybe occur because when you bring up eth1 you add again default gw and change routing. If you do not use network on eth0 to route traffic to internet or another lan network you can configure them without gw. Meybe solve problem.

    – 2707974
    Mar 26 '14 at 13:57











  • yes, you cannot configure two default gateways. Have a look at route and consider what interface should go to external networks, if any. If your eth0 works as intended, you should drop the gateway in eth1. edit: sorry this was meant as comment - not answer

    – benjaminR
    Mar 26 '14 at 14:20











  • I dropped the gateway from eth1, then restarted the network service. Same issue continues to occur. The odd thing is that when I restarted the network service, it says "failed to bring up eth1" but eth1 is the only one working.

    – user3070876
    Mar 26 '14 at 14:25








1




1





Problem maybe occur because when you bring up eth1 you add again default gw and change routing. If you do not use network on eth0 to route traffic to internet or another lan network you can configure them without gw. Meybe solve problem.

– 2707974
Mar 26 '14 at 13:57





Problem maybe occur because when you bring up eth1 you add again default gw and change routing. If you do not use network on eth0 to route traffic to internet or another lan network you can configure them without gw. Meybe solve problem.

– 2707974
Mar 26 '14 at 13:57













yes, you cannot configure two default gateways. Have a look at route and consider what interface should go to external networks, if any. If your eth0 works as intended, you should drop the gateway in eth1. edit: sorry this was meant as comment - not answer

– benjaminR
Mar 26 '14 at 14:20





yes, you cannot configure two default gateways. Have a look at route and consider what interface should go to external networks, if any. If your eth0 works as intended, you should drop the gateway in eth1. edit: sorry this was meant as comment - not answer

– benjaminR
Mar 26 '14 at 14:20













I dropped the gateway from eth1, then restarted the network service. Same issue continues to occur. The odd thing is that when I restarted the network service, it says "failed to bring up eth1" but eth1 is the only one working.

– user3070876
Mar 26 '14 at 14:25





I dropped the gateway from eth1, then restarted the network service. Same issue continues to occur. The odd thing is that when I restarted the network service, it says "failed to bring up eth1" but eth1 is the only one working.

– user3070876
Mar 26 '14 at 14:25










1 Answer
1






active

oldest

votes


















0














perhaps a problem with udev settings? First check that both interfaces show up in ifconfig -a and that they are handled correctly by udev:



cat /etc/udev/rules.d/70-persistent-net.rules


(check that mac address eth0 matches udev rule eth0, etc.)



Second, since you're using same nameserver on both NICs, accessible from eth1, perhaps the gateway should be on eth1 and enable forwarding between NICs?



echo 1 > /proc/sys/net/ipv4/ip_forward


Third, since your eth0 has a standard netmask/broadcast, try to leave out rules and let ubuntu figure out routing by only giving necessary info:



auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
dns-nameserver 192.168.1.21





share|improve this answer
























  • The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring.

    – user3070876
    Mar 26 '14 at 15:43













  • strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?

    – benjaminR
    Mar 27 '14 at 8:44











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f439482%2f12-04-server-multiple-ip-addresses-with-multiple-interfaces%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














perhaps a problem with udev settings? First check that both interfaces show up in ifconfig -a and that they are handled correctly by udev:



cat /etc/udev/rules.d/70-persistent-net.rules


(check that mac address eth0 matches udev rule eth0, etc.)



Second, since you're using same nameserver on both NICs, accessible from eth1, perhaps the gateway should be on eth1 and enable forwarding between NICs?



echo 1 > /proc/sys/net/ipv4/ip_forward


Third, since your eth0 has a standard netmask/broadcast, try to leave out rules and let ubuntu figure out routing by only giving necessary info:



auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
dns-nameserver 192.168.1.21





share|improve this answer
























  • The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring.

    – user3070876
    Mar 26 '14 at 15:43













  • strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?

    – benjaminR
    Mar 27 '14 at 8:44
















0














perhaps a problem with udev settings? First check that both interfaces show up in ifconfig -a and that they are handled correctly by udev:



cat /etc/udev/rules.d/70-persistent-net.rules


(check that mac address eth0 matches udev rule eth0, etc.)



Second, since you're using same nameserver on both NICs, accessible from eth1, perhaps the gateway should be on eth1 and enable forwarding between NICs?



echo 1 > /proc/sys/net/ipv4/ip_forward


Third, since your eth0 has a standard netmask/broadcast, try to leave out rules and let ubuntu figure out routing by only giving necessary info:



auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
dns-nameserver 192.168.1.21





share|improve this answer
























  • The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring.

    – user3070876
    Mar 26 '14 at 15:43













  • strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?

    – benjaminR
    Mar 27 '14 at 8:44














0












0








0







perhaps a problem with udev settings? First check that both interfaces show up in ifconfig -a and that they are handled correctly by udev:



cat /etc/udev/rules.d/70-persistent-net.rules


(check that mac address eth0 matches udev rule eth0, etc.)



Second, since you're using same nameserver on both NICs, accessible from eth1, perhaps the gateway should be on eth1 and enable forwarding between NICs?



echo 1 > /proc/sys/net/ipv4/ip_forward


Third, since your eth0 has a standard netmask/broadcast, try to leave out rules and let ubuntu figure out routing by only giving necessary info:



auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
dns-nameserver 192.168.1.21





share|improve this answer













perhaps a problem with udev settings? First check that both interfaces show up in ifconfig -a and that they are handled correctly by udev:



cat /etc/udev/rules.d/70-persistent-net.rules


(check that mac address eth0 matches udev rule eth0, etc.)



Second, since you're using same nameserver on both NICs, accessible from eth1, perhaps the gateway should be on eth1 and enable forwarding between NICs?



echo 1 > /proc/sys/net/ipv4/ip_forward


Third, since your eth0 has a standard netmask/broadcast, try to leave out rules and let ubuntu figure out routing by only giving necessary info:



auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
dns-nameserver 192.168.1.21






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 '14 at 15:10









benjaminRbenjaminR

11




11













  • The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring.

    – user3070876
    Mar 26 '14 at 15:43













  • strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?

    – benjaminR
    Mar 27 '14 at 8:44



















  • The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring.

    – user3070876
    Mar 26 '14 at 15:43













  • strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?

    – benjaminR
    Mar 27 '14 at 8:44

















The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring.

– user3070876
Mar 26 '14 at 15:43







The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring.

– user3070876
Mar 26 '14 at 15:43















strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?

– benjaminR
Mar 27 '14 at 8:44





strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?

– benjaminR
Mar 27 '14 at 8:44


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f439482%2f12-04-server-multiple-ip-addresses-with-multiple-interfaces%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?