1

For what I've looked up, this is not a duplicate. I need to connect a number of Ubuntu 16.04 machines together using a switch. I don't want them to be connected to the Internet, so I have no router or ISP info. I have set manual IPs but don't know what to put for dns and gateway. Also, I don't know the switch IP.

These are the IP's:
192.168.2.1,
192.168.2.2,
and so on

the mask:
255.255.255.0 for all

the DNS: ?

the gateway: ?

Another problem is I don't know if two interfaces are for two network cards or that one network card can have multiple interfaces too. Please explain that as well.

Also, The interface I'm trying to tweak (in /etc/network/interfaces) seems to be inactive for it doesnt show up when doing ipconfig.

Also, could you please specify what files should I edit and how they should be like after the configuration (cause Ubuntu edits them itself sometimes)?

Currently when I ping the other machines from one I get Destination Host Unreachable.

Thanks

Edit:

/etc/network/interfaces file now:

auto lo
iface lo inet loopback

it used to be like:

auto lo
iface lo inet loopback
iface enp6s0 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.1 auto enp6s0
Ali
  • 11
  • 4
  • So how did you configure `/etc/network/interfaces`? And what is the actual interface in your system? – Michael Hampton Oct 30 '16 at 04:43
  • @MichaelHampton when I do ifconfig -a, I see that I have two interfaces (eth***). There are also two slots for a Ethernet cable to be plugged in at the back of the case (but I don't know the correspondence if any). Right now the interfaces file is empty cause I read that network manager gui doesn't deal with that file, but I once tried filling it in (See the edit plz). – Ali Oct 30 '16 at 05:32

1 Answers1

1

You have to statically configure everything. On both servers (the relevant section for the interface):

auto eth0
iface eth0 inet static
    address 192.168.2.2 # or 192.168.2.1 of course, depending
    netmask 255.255.255.0

If networkmanager is installed, you may want to remove that.

There is no gateway IP.

There is no DNS either. Specify hostnames for convenience in /etc/hosts

Look at the output of ethtool (you may need to install it) and ifconfig -a to see which interface is what. With ethtool you can also see which interface has a cable installed.

Your switch probably doesn't have an IP address, because had it been a managed switch, you would have probably mentioned it.

Halfgaar
  • 7,921
  • 5
  • 42
  • 81
  • I still get Destination Host Unreachable. – Ali Oct 31 '16 at 05:35
  • @Ali did you make a corresponding config for your actual interface names, like `enp6s0`? – Halfgaar Oct 31 '16 at 18:33
  • Yes, I changed the names to eth0 and eth1 by the way. I have set the ips just like above. I haven't specified any DNS or gateway. I still get the same message. As for the switch, I don't know if it is a managed switch or not and if it has an IP address. – Ali Oct 31 '16 at 22:57
  • @Ali perhaps you can edit your original question to show us what you have now. – Halfgaar Nov 01 '16 at 08:35
  • I've set everything in the gui. the /etc/network/interfaces file is empty. Is that a problem and if so, why? – Ali Nov 01 '16 at 17:38