I arrived at a solution after watching the following video: https://www.youtube.com/watch?v=yqJ9PXhqOAQ
- Launch Network Connections, e.g. by clicking on the network icon at the upper right and choosing "Edit Connections..."
- Select the "Wired connection #" corresponding to the Ethernet port that will be connected to the switch. Choose "Edit..."
- Under the IPv4 Settings tab, change the Method drop-down from "Automatic (DHCP)" to "Disabled"
- Choose "Save..." A duplicate connection may appear in the list; choose "Close" and re-open Network Connections, and the duplicate will be gone (the duplicate item is a bug)
- Choose "Add", select "Ethernet", and choose "Create..."
- Type any name, e.g. "Cameras switch"
- Under the IPv4 Settings tab, change the Method drop-down to "Manual"
- Choose "Add" next to Addresses, and set Address to some value (e.g. 10.0.0.9) and Netmask to 255.255.255.0; leave Gateway blank. The address is for the Ubuntu computer, so it should be different from the camera addresses.
- Fill the DNS servers field with some address, e.g. 10.0.0.10
- Choose "Save..." and "Close"
Plug the switch into the Ethernet port. The "Cameras switch" connection should connect automatically. Now the network camera browser interface can be accessed at its IP address. Using ping
followed by the camera's IP address in Terminal should also be successful. Additionally, connecting to the wireless network allows access to the internet (e.g. www.wikipedia.org) in addition to the network camera at its IP address.
(Everything works acceptably now, but if anyone could explain in the comments the Default router field in the Axis camera TCP/IP browser settings (see the second image in the question text) or the DNS servers field under the IPv4 Settings tab when creating a manual Ethernet connection I'd be grateful. I'm not sure what role those addresses play.)
Note that everything can be undone relatively easily by deleting the "Cameras switch" connection and setting "Wired connection #" from "Disabled" back to "Automatic (DHCP)"
Please see down at NOTE as extra IPs came back again. So I believe I found what was wrong and how to stop them from getting the extra IPs.
I'm writing this up as an answer because when I tried with netplan I was getting unstable connections with extra IPs appearing on my network cards.
On 20.04 LTS using kernel 5.4.0-54-generic.
Using ifupdown
and setting the /etc/network/interfaces
file as I dumped netplan all together.
Installed ifupdown
and ifenslave
sudo apt install ifupdown ifenslave
Removed netplan:
sudo apt remove netplan.io
Next, I stopped the systemd-networkd
and systemd-networkd.socket
:
systemctl stop systemd-networkd.service
systemctl stop systemd-networkd.socket
systemctl disable systemd-networkd.service
systemctl disable systemd-networkd.socket
Check your /etc/modules
for the following lines:
loop
lp
rtc
bonding
I also setup so I am not using predictive naming for my ethernet cards. I have heard from people saying that it can be bad, but it has always worked for me.
Added the following to the /etc/default/grub
file then ran sudo update-grub
and rebooted for changes to take effect.
GRUB_CMDLINE_LINUX_DEFAULT="nosplash net.ifnames=0 biosdevnames=0"
Then added my interfaces to /etc/network/interfaces
with bonding setup for balance-alb
:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
bond-master bond0
auto eth1
iface eth1 inet manual
bond-master bond0
auto bond0
iface bond0 inet static
address 10.0.0.220
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1
bond-mode balance-alb
bond-miimon 100
bond-slaves eth0 eth1
I also made it so my resolv.conf
was no longer controlled by stub or anything else.
sudo unlink /etc/resolv.conf
echo "nameserver 10.0.0.1" | sudo tee /etc/resolv.conf
You can change your nameserver to whatever your router is or if you want to use 8.8.8.8.
You can add more nameservers with tee -a
as well to the resolv.conf
:
echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
Feb. 25, 2021 Note: I recently had an update to my system and it kicked back on my cards to receiving extra IPs again. To resolve this I had to add denyinterfaces eth0 eth1
to the /etc/dhcpcd.conf
file. Below is what my /etc/dhcpcd.conf
file looks like. Make changes as needed for your network.
denyinterfaces eth0 eth1
interface bond0
static ip_address=10.0.0.220/24
static routers=10.0.0.1
static domain_name_servers=9.9.9.9 149.112.112.112
Apply those network settings:
sudo /etc/init.d/networking restart
Checked with ifconfig
and checked /proc/net/bonding/bond0
ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.0.0.220 netmask 255.255.255.0 broadcast 10.0.0.255
ether bc:5f:f4:79:66:fe txqueuelen 1000 (Ethernet)
RX packets 85381 bytes 12752852 (12.7 MB)
RX errors 0 dropped 5 overruns 0 frame 0
TX packets 125655 bytes 156764973 (156.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether bc:5f:f4:79:66:fe txqueuelen 1000 (Ethernet)
RX packets 76259 bytes 10724189 (10.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12520 bytes 4905475 (4.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether c8:3a:35:d6:ec:a0 txqueuelen 1000 (Ethernet)
RX packets 9122 bytes 2028663 (2.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 113135 bytes 151859498 (151.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 55907 bytes 158911787 (158.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 55907 bytes 158911787 (158.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
and
cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: bc:5f:f4:79:66:fe
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: c8:3a:35:d6:ec:a0
Slave queue ID: 0
Best Answer
I do something like that at work using Ubuntu 11.04. We run the Shorewall firewall configuration tool, which besides being excellent at its job, provides some rudimentary multiple ISP routing tools which might fit your needs. You can find some docs about it here: http://www.shorewall.net/MultiISP.html
What it comes down to though, is you can't use multiple ISPs for a single connection... things aren't that simple. The best you can do is try to direct new connections evenly between the different providers.
It is a complex problem. You will probably end up beating your head against the wall (I certainly did) before you are done debugging every problem. So, as other posters have suggested, you might be wise to carefully consider how strong your desire is.