0

Situation:

I have a PC and a server (not virtual machine). I'm completely new to configuring hardware. I need to setup Ethernet network using LAN cable. Ethernet cable is connected directly from PC to the server (without Ethernet switch).

PC information:

Operating system: Ubuntu Desktop 16.04.4
Architecture: 64-bit (AMD64)
Connected to the Internet (wi-fi): yes (wi-fi)
Network interfaces ($ ipconfig -a):

enp4s0    Link encap:Ethernet  HWaddr 90:2b:34:18:80:37  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3872 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3872 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:283996 (283.9 KB)  TX bytes:283996 (283.9 KB)

Network card ($ lspci | egrep -i --color 'network|ethernet'):

04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)


Server information:

Model: HP ProLiant DL580 G7 ( full manual )
Operating system: Ubuntu Server 16.04.4
Architecture: 64-bit (AMD64)
Connected to the Internet (wi-fi): no

Questions:

How to setup Ethernet network between server and PC?
Is there any specific problems connected to the specifications I have on my server?

Thanks for the help

1

You will need to statically assign IP addresses for both machines.

PC: 192.168.10.1 255.255.255.0

Server: 192.168.10.2 255.255.255.0

For headles Ubuntu server network config you will need to edit /etc/network/interfaces Useful article here Example config for server:

# The primary network interface 
auto enp4s0
iface enp4s0 inet static 
address 192.168.10.2 
netmask 255.255.255.0 
network 192.168.10.0 
broadcast 192.168.10.255 

You won't have internet with this configuration because routing would need to be configured through your PC.

Also, not likely but there could be a need for a crossover cable because you're going device to device though most modern NICs handle this automatically.

Note: you could limit the address range with CIDR 192.168.10.0/30 only allowing the two devices.

| improve this answer | |
  • I think you forgot the article link. – TheWanderer Aug 2 '18 at 3:56
0

From Bennett answer:

In order to connect two machines using Local network (Ethernet) you need to:

1. Connect the LAN cable to the server and to the personal computer

2. Add network interface to the server:

Run sudo nano /etc/network/interfaces in your terminal.

Add this snippet to the file:

# My Ethernet interface
auto enp4s0f0
iface enp4s0f0 inet static
address 192.168.10.2
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

Save the file using Ctrl + X shortcut.

Run sudo reboot in your terminal in order to setup new configuration.

3. Add network interface to the personal computer:

Run sudo nano /etc/network/interfaces in your terminal.

Add this snippet to the file:

# My Ethernet interface
auto enp4s0
iface enp4s0 inet static
address 192.168.10.1
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

Save the file using Ctrl + X shortcut.

Run sudo reboot in your terminal in order to setup new configuration.

4. Congratulations! Your Ethernet connection between server and personal computer is setup

5. P.S:

Notice, that you need to configure snippet of the interface for yourself. Here is a template:

# My Ethernet interface
auto <interface_name>
iface <interface_name> inet static
address <ip_address>
netmask <netmask>
network <network_address>
broadcast <broadcast_address>

Where:

<interface_name>: name of the interface (run ifconfig -a to get the list of interfaces)
<ip_address>: IPv4 address of the interface (template: ip1.ip2.ip3.ip4)
<netmask>: netmask of the interface (usually 255.255.255.0)
<network_address>: IPv4 address of the network of the interface (ip1.ip2.ip3.0)
<broadcast_address>: IPv4 address of the broadcast of the interface (ip1.ip2.ip3.255)

| improve this answer | |

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.