LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-09-2020, 06:13 AM   #1
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Rep: Reputation: 2
Bonding 2 NICS question


Hello

I would like to bond the 2 network interfaces on my Ubuntu server 18.04. There is information online about how to go about it, however I am confused about which IP information should I put in the bonding config file. The machine has two NICs. One is called eno1 and the second one enp13s0. Both interfaces are online and pinging.

Which IP address should I use for the bonding? Will it be a completely new IP? or can I use the IP of one of the live interfaces?

Thank you
 
Old 01-09-2020, 07:10 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by yangou View Post
The machine has two NICs. One is called eno1 and the second one enp13s0. Both interfaces are online and pinging.

Which IP address should I use for the bonding? Will it be a completely new IP? or can I use the IP of one of the live interfaces?
Only the bonded NIC will have IP, see this for example:
https://www.interserver.net/tips/kb/...twork-bonding/

Perhaps, share your config files (feel free to mask the IPs), so we can understand and help?

Last edited by dc.901; 01-09-2020 at 07:11 AM.
 
Old 01-13-2020, 06:29 AM   #3
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Original Poster
Rep: Reputation: 2
Hello

Sorry for my late reply. I understand that only the bonded NIC will have an IP address. What I am not sure about is what IP should I use for the bonding NIC? My /etc/network/interfaces file looks like this:

Quote:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#network card DHCPing
auto eno1
iface eno1 inet dhcp
ip a shows:

Quote:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp13s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether d0:50:99:d3:25:66 brd ff:ff:ff:ff:ff:ff
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether d0:50:99:d3:25:67 brd ff:ff:ff:ff:ff:ff
inet 10.64.8.201/24 brd 10.64.8.255 scope global eno1
valid_lft forever preferred_lft forever
inet6 fe80::d250:99ff:fed3:2567/64 scope link
valid_lft forever preferred_lft forever


eno1 is DHCPing and working. enp13s0 is currently unpatched. I read online that on ubuntu 18.04 netplan is used to do NIC bonding by creating a file inside /etc/netplan/my_net.yaml. Which IP should I use in the config file (my_net.yaml)? Can I use the one from eno1?

Thank you

Last edited by yangou; 01-13-2020 at 06:31 AM.
 
Old 01-13-2020, 06:58 AM   #4
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by yangou View Post
Which IP should I use in the config file (my_net.yaml)? Can I use the one from eno1?
Certainly, you can use IP from eno1. Since there is DHCP, you may want to set DHCP server to reserve that IP, so no other client can get it.
 
Old 01-13-2020, 07:16 AM   #5
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,150

Rep: Reputation: 393Reputation: 393Reputation: 393Reputation: 393
I'm curious how it is getting eno1 if you are using 18.04. Systemd uses it's own naming scheme (read enp13s0). eno, eth, ens, and any others should no longer show up. Netplan is also used and /etc/network/interfaces should do nothing without the ifupdown package, which shouldn't be installed on 18.04. If this is an upgrade from 16.04 then you would still use /etc/network/interfaces at which point you shouldn't be using netplan unless you manually switch to it. 16.04 also used systemd so there is still no explanation for how eno is showing up there either. May want to sort that out first. Something is not right and until the base issue is fixed this will be a headache, if you get it working at all. Here is a netplan guide once you get sorted out.

*EDIT* Maybe I misunderstand how systemd does interface names. Your ip a command doesn't make any sense to me. I will readily admit I could be wrong on these points. *END EDIT*

https://netplan.io/examples

I would adjust their bond example to the below based on my own experience. I'm not sure how old that guide is but the formatting they have for a bond, which is similar to static ip's didn't work in my case. The below would probably work (based on what I eventually got working and other parts of the same guide). Single spaces, no tabs. Indentation is key in Yaml files.

*EDIT* Just did some looking around. Isn't in the guide but it appears some people have had to declare the interfaces individually with dhcp4/6: false in their netplan configs for bonds. I'm not sure if it's required or not as I cannot test it. They would be declared in the netplan config like so.

Code:
network:
 version: 2
 renderer: networkd
 ethernets:
  enp3s0:
   dhcp4: false
   dhcp6: false
  enp4s0:
   dhcp4: false
   dhcp6: false
*END EDIT*

Code:
network:
 version: 2
 renderer: networkd
 bonds:
  bond0:
   dhcp4: yes
   interfaces: [enp3s0, enp4s0]
   parameters:
    mode: active-backup
    primary: enp3s0
static ip. adjust as needed to your situation.

Code:
network:
 version: 2
 renderer: networkd
 bonds:
  bond0:
   dhcp4: false
   dhcp6: false
   addresses: [192.168.1.2/24]
   gateway4: 192.168.1.1
   nameservers:
    addresses: [8.8.8.8, 8.8.4.4]
   interfaces: [enp3s0, enp4s0]
   parameters:
    mode: active-backup
    primary: enp3s0
hell why not create a bridge for containers and virtual machines? no clue if this one works, but why not? if i had a dual nic server i'd try it just for the fun of it. any server i setup i automatically make a bridge. never know and it's easy enough to do.

Code:
network:
 version: 2
 renderer: networkd
 bonds:
  bond0:
   dhcp4: false
   dhcp6: false
   interfaces: [enp3s0, enp4s0]
   parameters:
    mode: active-backup
    primary: enp3s0
 bridges:
  br0:
   dhcp4: false
   dhcp6: false
   interfaces: [bond0]
   addresses: [192.168.1.2/24]
   gateway4: 192.168.1.1
   nameservers:
    addresses: [8.8.8.8, 8.8.4.4]

Last edited by jmgibson1981; 01-13-2020 at 09:13 AM.
 
Old 01-23-2020, 04:26 AM   #6
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Original Poster
Rep: Reputation: 2
Thank you both for your time. You have helped me understand a few things. My NIC bonding is working now.

ALl the best.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is bond0 ready and a bonding interface? - 4G Bonding Router Problems Elliottlc Linux - Networking 5 10-22-2014 02:37 PM
bonding 2 NICs CentOS 6.4 question lleb Linux - Hardware 0 09-04-2013 05:44 AM
bonding bonding-xor and bonding-alb Chrysalis Linux - Networking 1 10-24-2009 02:14 PM
bonding and vlans. Bonding a vlan interface vs applying vlans to a bond interface JasonCzerak Linux - Networking 0 09-11-2008 09:59 AM
Infiniband Bonding and Ethernet Bonding edcrozer Linux - Networking 0 11-07-2007 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration