0

Here is my /etc/network/interfaces configuration:

# This file describes the network interfaces available on your system
# and how to activate 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 dhcp

auto eth1
iface eth1 inet dhcp

Here is what i receive on ip addr show:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:db:15:99 brd ff:ff:ff:ff:ff:ff
    inet 46.10.223.61/22 brd 46.10.223.255 scope global eth0
    inet6 fe80::20c:29ff:fedb:1599/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:db:15:a3 brd ff:ff:ff:ff:ff:ff
    inet 46.10.223.65/22 brd 46.10.223.255 scope global eth1
    inet6 fe80::20c:29ff:fedb:15a3/64 scope link
       valid_lft forever preferred_lft forever

Is it possible to have 2 static IP addresses on one machine when you have two LAN cards?

My internet connection is thru dhcp.

With this configuration all the IPs can be pinged from the machine itself but when i try to ping IPs from other machine only the IP from eth1 is reachable.

So how can i make both IPs reachable?

In this case i have to able to ping 46.10.223.61 and 46.10.223.65 but right now i can ping only 46.10.223.65, why, where is my mistake ?

I am using Ubuntu Server 14.04 x64

Thanks in advance!

0

I would like to highlight couple of things here.

  1. Your configuration is not for static IP , its for dynamic IP in the given network range.

    # The primary network interface
    auto eth0
    iface eth0 inet dhcp
    
    auto eth1
    iface eth1 inet dhcp
    
    1. If you want static IP really then instead of dhcp you have to use static along with IP Address and other required information.

For example:

auto eth1
iface eth1 inet static
        address 192.168.56.102
        netmask 255.255.255.0
  1. type ifconfig -a then you will come to know what IP's actually assigned to your two interfaces. And for these two IP's if you cant ping then its an Issue.
  • How can i see the netmask ? I have done what you say and now i can ping the IP from eth0 but not the IP from eth1. It's very strange. – Venelin Vasilev Mar 8 '16 at 17:46
  • Should i left the configuration for eth0 as it is right now ? – Venelin Vasilev Mar 8 '16 at 17:53
  • can you just ping me output of ifconfig -a – rɑːdʒɑ Mar 8 '16 at 18:06
  • Here it is: pastebin.com/hNEFA0GU tell me if you need anything more. – Venelin Vasilev Mar 8 '16 at 18:18
  • Ping to these IP are working or not ? 46.10.223.61 , 46.10.223.65 If yes there is nothing wrong and you have dynamic IP configuration not static. To make static use sample configuration as i have mentioned above according to your need. – rɑːdʒɑ Mar 8 '16 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.