Routing, DNS resolution with Bond0
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am having issues on 18.04 Server when I switch from dhcp to static IP on my device. The reason I was switching is that I was getting a new IP address on my server randomly even though my router had a reserved static IP address for my primary interface (eth0). I switched to static and now I'm having issues resolving /routing to my gateway. My setup has three interfaces (eth0 (primary), eth1, eth3). Don't know what is really causing the issues with the bond0 implementation. Data is moving ok within the network but outside is not and therefore I am unable to update the system unless I swap back to dhcp and live with the randomly changing dhcp address.
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
# primary network card
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0
# second network interface card
auto eth1
iface eth1 inet manual
bond-master bond0
# third network interface card
auto eth3
iface eth3 inet manual
bond-master bond0
# bond0 network interface
auto bond0
iface bond0 inet static
address 192.168.0.100
gateway 192.168.0.1
netmask 255.255.255.0
dns-nameservers 192.168.0.1 208.67.222.222 208.67.220.220
bond_mode 6
bond-miimon 100
bond-slaves none
ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::6ef0:49ff:fe5e:c194 prefixlen 64 scopeid 0x20<link>
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 298900 bytes 19550931 (19.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2089172 bytes 3153193403 (3.1 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 354297 bytes 21749288 (21.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15785 bytes 15597970 (15.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6147<UP,BROADCAST,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c9:95 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth3: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:14:5e:77:45:c6 txqueuelen 1000 (Ethernet)
RX packets 296791 bytes 19306412 (19.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4487992 bytes 6786908424 (6.7 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xfdee0000-fdf00000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 7759 bytes 1630081 (1.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7759 bytes 1630081 (1.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
root@mediasvr:/home/xxxx# ping www.cnn.com
ping: www.cnn.com: Temporary failure in name resolution
root@mediasvr:/home/xxxx# nslookup www.cnn.com
;; connection timed out; no servers could be reached
root@mediasvr:/home/xxxx# ping 192.168.0.100
PING 192.168.0.100 (192.168.0.100) 56(84) bytes of data.
64 bytes from 192.168.0.100: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 192.168.0.100: icmp_seq=2 ttl=64 time=0.053 ms
--- 192.168.0.100 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1028ms
rtt min/avg/max/mdev = 0.053/0.056/0.059/0.003 ms
**root@mediasvr:/home/xxxx# ping 192.168.0.1**
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.100 icmp_seq=4 Destination Host Unreachable
From 192.168.0.100 icmp_seq=5 Destination Host Unreachable
From 192.168.0.100 icmp_seq=6 Destination Host Unreachable
From 192.168.0.100 icmp_seq=16 Destination Host Unreachable
From 192.168.0.100 icmp_seq=17 Destination Host Unreachable
From 192.168.0.100 icmp_seq=18 Destination Host Unreachable
From 192.168.0.100 icmp_seq=19 Destination Host Unreachable
From 192.168.0.100 icmp_seq=20 Destination Host Unreachable
--- 192.168.0.1 ping statistics ---
23 packets transmitted, 0 received, +8 errors, 100% packet loss, time 22504ms
root@mediasvr:/home/xxxx# systemd-resolve --status
Global
DNS Servers: 192.168.0.1
208.67.222.222
208.67.220.220
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 8 (bond0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 6 (eth4)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 5 (eth3)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 4 (eth2)
Current Scopes: none
LLMNR setting: yes
I am including the additional information requested.
root@mediasvr:/etc/netplan# cat 50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
bond0:
dhcp4: no
dhcp6: no
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
addresses: [208.67.222.222, 208.67.220.220]
root@mediasvr:/etc/netplan# ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 27 Apr 12 14:40 /etc/resolv.conf -> /run/resolvconf/resolv.conf
root@mediasvr:/etc/netplan# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 208.67.222.222,
nameserver 208.67.220.220
nameserver 127.0.0.53
@heynnema - Update
So I changed both the interface and the .yaml file and applied the netplan without errors (debug) however, I am still having network issues:
- I can ping my interface
- Team bond is fine according to /proc/net/bonding/bond0 (static)
However, - Route command delays to pop up
- Unable to ping the gateway
- Unable to resolve DNS
Here are the updates I performed:
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
/etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
eth3:
dhcp4: no
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update (Thank you for your expertise/time. I believe we are getting closer to resolving this problem)
I enabled an extra unused interface and set it to dhcp in the yaml file and applied via netplan. I kept the team bond the same on the existing 3 nics (eth1-eth3)
eth4:
dhcp4: true
optional: true
root@mediasvr:/home/raul# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 0 0 0 bond0
default _gateway 0.0.0.0 UG 100 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
_gateway 0.0.0.0 255.255.255.255 UH 100 0 0 eth4
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
root@mediasvr:/home/raul# traceroute 192.168.01
traceroute to 192.168.01 (192.168.0.1), 64 hops max
1 192.168.0.1 0.569ms 0.359ms 0.370ms
- I am able to ping/perform traceroute to the gateway which I couldn't before.
- I can perform DNS lookups
- I can ssh into the server remotely via dhcp address
However,
4. I am unable to connect to repositories to get updates
- connect (113: No route to host) Could not connect to archive.ubuntu.com:80 (91.189.88.149).
5. I am unable to connect to the plex media server which is now listening on the dhcp address
tcp 0 0 mediasvr:32400 192.168.0.11:10558 TIME_WAIT
tcp 0 0 mediasvr:49206 mediasvr:32400 ESTABLISHED
@heynnema - Updated yaml file (would you rather continue this in a chat?)
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [192.168.0.1, 208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update - I've applied your suggestion on the yaml changes. It appears that it has improved a couple of things. Specifically;
- I can now ping both eth4 and bond0 internally/externally and the gateway.
- DNS resolution works
- I can SSH into the server
However,
1. Plex uses the first nic it sees which in this case is the dhcp interface
2. I am unable to interact with the internet
UPDATED Yaml file
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses:
- 192.168.0.100/24
#gateway4: 192.168.0.1
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
networking ethernet
New contributor
|
show 12 more comments
I am having issues on 18.04 Server when I switch from dhcp to static IP on my device. The reason I was switching is that I was getting a new IP address on my server randomly even though my router had a reserved static IP address for my primary interface (eth0). I switched to static and now I'm having issues resolving /routing to my gateway. My setup has three interfaces (eth0 (primary), eth1, eth3). Don't know what is really causing the issues with the bond0 implementation. Data is moving ok within the network but outside is not and therefore I am unable to update the system unless I swap back to dhcp and live with the randomly changing dhcp address.
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
# primary network card
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0
# second network interface card
auto eth1
iface eth1 inet manual
bond-master bond0
# third network interface card
auto eth3
iface eth3 inet manual
bond-master bond0
# bond0 network interface
auto bond0
iface bond0 inet static
address 192.168.0.100
gateway 192.168.0.1
netmask 255.255.255.0
dns-nameservers 192.168.0.1 208.67.222.222 208.67.220.220
bond_mode 6
bond-miimon 100
bond-slaves none
ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::6ef0:49ff:fe5e:c194 prefixlen 64 scopeid 0x20<link>
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 298900 bytes 19550931 (19.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2089172 bytes 3153193403 (3.1 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 354297 bytes 21749288 (21.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15785 bytes 15597970 (15.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6147<UP,BROADCAST,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c9:95 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth3: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:14:5e:77:45:c6 txqueuelen 1000 (Ethernet)
RX packets 296791 bytes 19306412 (19.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4487992 bytes 6786908424 (6.7 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xfdee0000-fdf00000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 7759 bytes 1630081 (1.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7759 bytes 1630081 (1.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
root@mediasvr:/home/xxxx# ping www.cnn.com
ping: www.cnn.com: Temporary failure in name resolution
root@mediasvr:/home/xxxx# nslookup www.cnn.com
;; connection timed out; no servers could be reached
root@mediasvr:/home/xxxx# ping 192.168.0.100
PING 192.168.0.100 (192.168.0.100) 56(84) bytes of data.
64 bytes from 192.168.0.100: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 192.168.0.100: icmp_seq=2 ttl=64 time=0.053 ms
--- 192.168.0.100 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1028ms
rtt min/avg/max/mdev = 0.053/0.056/0.059/0.003 ms
**root@mediasvr:/home/xxxx# ping 192.168.0.1**
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.100 icmp_seq=4 Destination Host Unreachable
From 192.168.0.100 icmp_seq=5 Destination Host Unreachable
From 192.168.0.100 icmp_seq=6 Destination Host Unreachable
From 192.168.0.100 icmp_seq=16 Destination Host Unreachable
From 192.168.0.100 icmp_seq=17 Destination Host Unreachable
From 192.168.0.100 icmp_seq=18 Destination Host Unreachable
From 192.168.0.100 icmp_seq=19 Destination Host Unreachable
From 192.168.0.100 icmp_seq=20 Destination Host Unreachable
--- 192.168.0.1 ping statistics ---
23 packets transmitted, 0 received, +8 errors, 100% packet loss, time 22504ms
root@mediasvr:/home/xxxx# systemd-resolve --status
Global
DNS Servers: 192.168.0.1
208.67.222.222
208.67.220.220
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 8 (bond0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 6 (eth4)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 5 (eth3)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 4 (eth2)
Current Scopes: none
LLMNR setting: yes
I am including the additional information requested.
root@mediasvr:/etc/netplan# cat 50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
bond0:
dhcp4: no
dhcp6: no
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
addresses: [208.67.222.222, 208.67.220.220]
root@mediasvr:/etc/netplan# ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 27 Apr 12 14:40 /etc/resolv.conf -> /run/resolvconf/resolv.conf
root@mediasvr:/etc/netplan# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 208.67.222.222,
nameserver 208.67.220.220
nameserver 127.0.0.53
@heynnema - Update
So I changed both the interface and the .yaml file and applied the netplan without errors (debug) however, I am still having network issues:
- I can ping my interface
- Team bond is fine according to /proc/net/bonding/bond0 (static)
However, - Route command delays to pop up
- Unable to ping the gateway
- Unable to resolve DNS
Here are the updates I performed:
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
/etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
eth3:
dhcp4: no
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update (Thank you for your expertise/time. I believe we are getting closer to resolving this problem)
I enabled an extra unused interface and set it to dhcp in the yaml file and applied via netplan. I kept the team bond the same on the existing 3 nics (eth1-eth3)
eth4:
dhcp4: true
optional: true
root@mediasvr:/home/raul# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 0 0 0 bond0
default _gateway 0.0.0.0 UG 100 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
_gateway 0.0.0.0 255.255.255.255 UH 100 0 0 eth4
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
root@mediasvr:/home/raul# traceroute 192.168.01
traceroute to 192.168.01 (192.168.0.1), 64 hops max
1 192.168.0.1 0.569ms 0.359ms 0.370ms
- I am able to ping/perform traceroute to the gateway which I couldn't before.
- I can perform DNS lookups
- I can ssh into the server remotely via dhcp address
However,
4. I am unable to connect to repositories to get updates
- connect (113: No route to host) Could not connect to archive.ubuntu.com:80 (91.189.88.149).
5. I am unable to connect to the plex media server which is now listening on the dhcp address
tcp 0 0 mediasvr:32400 192.168.0.11:10558 TIME_WAIT
tcp 0 0 mediasvr:49206 mediasvr:32400 ESTABLISHED
@heynnema - Updated yaml file (would you rather continue this in a chat?)
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [192.168.0.1, 208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update - I've applied your suggestion on the yaml changes. It appears that it has improved a couple of things. Specifically;
- I can now ping both eth4 and bond0 internally/externally and the gateway.
- DNS resolution works
- I can SSH into the server
However,
1. Plex uses the first nic it sees which in this case is the dhcp interface
2. I am unable to interact with the internet
UPDATED Yaml file
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses:
- 192.168.0.100/24
#gateway4: 192.168.0.1
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
networking ethernet
New contributor
Edit your question and show mecat /etc/netplan/*
andls -al /etc/resolv.conf
andcat /etc/resolv.conf
. Report back. Start comments to me with @heynnema
– heynnema
yesterday
@heynnema - I've supplied the additional information you requested
– Raul Maldonado
13 hours ago
You've mixed and matched NetworkManager and netplan scripts at the same time. Netplan is normally used in servers, where the configuration is very static. All of the entries that you added to/etc/network/interfaces
(except for the original 8 lines) need to be deleted, and moved to/etc/netplan/*.yaml
in "netplan-ez" language. See netplan.io/examples for guidance. To pick up the reserved addresses in your router, you must setdhcp4: true
in your .yaml file. And your bond0 must define what interfaces to use.
– heynnema
13 hours ago
@heynnema - I've made the changes to both files, see edits and thanks for the input. I still am having issues
– Raul Maldonado
10 hours ago
A couple of things... in /etc/resolv.conf I see "nameserver 208.67.222.222," and I don't know if it's a typo, but there should not be a trailing ",". How/where are those OpenDNS server addresses coming from? Your .yaml looks good to me. I'd add "optional: true" to eth0/1/3 so there's no boot delay. I'd remove the dhcp reserved address for eth0 from your router. Please explain... which ethX is your WAN? What about eth2? What's on eth1/3, and are those really the ports you want to bond?
– heynnema
10 hours ago
|
show 12 more comments
I am having issues on 18.04 Server when I switch from dhcp to static IP on my device. The reason I was switching is that I was getting a new IP address on my server randomly even though my router had a reserved static IP address for my primary interface (eth0). I switched to static and now I'm having issues resolving /routing to my gateway. My setup has three interfaces (eth0 (primary), eth1, eth3). Don't know what is really causing the issues with the bond0 implementation. Data is moving ok within the network but outside is not and therefore I am unable to update the system unless I swap back to dhcp and live with the randomly changing dhcp address.
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
# primary network card
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0
# second network interface card
auto eth1
iface eth1 inet manual
bond-master bond0
# third network interface card
auto eth3
iface eth3 inet manual
bond-master bond0
# bond0 network interface
auto bond0
iface bond0 inet static
address 192.168.0.100
gateway 192.168.0.1
netmask 255.255.255.0
dns-nameservers 192.168.0.1 208.67.222.222 208.67.220.220
bond_mode 6
bond-miimon 100
bond-slaves none
ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::6ef0:49ff:fe5e:c194 prefixlen 64 scopeid 0x20<link>
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 298900 bytes 19550931 (19.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2089172 bytes 3153193403 (3.1 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 354297 bytes 21749288 (21.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15785 bytes 15597970 (15.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6147<UP,BROADCAST,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c9:95 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth3: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:14:5e:77:45:c6 txqueuelen 1000 (Ethernet)
RX packets 296791 bytes 19306412 (19.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4487992 bytes 6786908424 (6.7 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xfdee0000-fdf00000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 7759 bytes 1630081 (1.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7759 bytes 1630081 (1.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
root@mediasvr:/home/xxxx# ping www.cnn.com
ping: www.cnn.com: Temporary failure in name resolution
root@mediasvr:/home/xxxx# nslookup www.cnn.com
;; connection timed out; no servers could be reached
root@mediasvr:/home/xxxx# ping 192.168.0.100
PING 192.168.0.100 (192.168.0.100) 56(84) bytes of data.
64 bytes from 192.168.0.100: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 192.168.0.100: icmp_seq=2 ttl=64 time=0.053 ms
--- 192.168.0.100 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1028ms
rtt min/avg/max/mdev = 0.053/0.056/0.059/0.003 ms
**root@mediasvr:/home/xxxx# ping 192.168.0.1**
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.100 icmp_seq=4 Destination Host Unreachable
From 192.168.0.100 icmp_seq=5 Destination Host Unreachable
From 192.168.0.100 icmp_seq=6 Destination Host Unreachable
From 192.168.0.100 icmp_seq=16 Destination Host Unreachable
From 192.168.0.100 icmp_seq=17 Destination Host Unreachable
From 192.168.0.100 icmp_seq=18 Destination Host Unreachable
From 192.168.0.100 icmp_seq=19 Destination Host Unreachable
From 192.168.0.100 icmp_seq=20 Destination Host Unreachable
--- 192.168.0.1 ping statistics ---
23 packets transmitted, 0 received, +8 errors, 100% packet loss, time 22504ms
root@mediasvr:/home/xxxx# systemd-resolve --status
Global
DNS Servers: 192.168.0.1
208.67.222.222
208.67.220.220
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 8 (bond0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 6 (eth4)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 5 (eth3)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 4 (eth2)
Current Scopes: none
LLMNR setting: yes
I am including the additional information requested.
root@mediasvr:/etc/netplan# cat 50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
bond0:
dhcp4: no
dhcp6: no
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
addresses: [208.67.222.222, 208.67.220.220]
root@mediasvr:/etc/netplan# ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 27 Apr 12 14:40 /etc/resolv.conf -> /run/resolvconf/resolv.conf
root@mediasvr:/etc/netplan# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 208.67.222.222,
nameserver 208.67.220.220
nameserver 127.0.0.53
@heynnema - Update
So I changed both the interface and the .yaml file and applied the netplan without errors (debug) however, I am still having network issues:
- I can ping my interface
- Team bond is fine according to /proc/net/bonding/bond0 (static)
However, - Route command delays to pop up
- Unable to ping the gateway
- Unable to resolve DNS
Here are the updates I performed:
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
/etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
eth3:
dhcp4: no
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update (Thank you for your expertise/time. I believe we are getting closer to resolving this problem)
I enabled an extra unused interface and set it to dhcp in the yaml file and applied via netplan. I kept the team bond the same on the existing 3 nics (eth1-eth3)
eth4:
dhcp4: true
optional: true
root@mediasvr:/home/raul# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 0 0 0 bond0
default _gateway 0.0.0.0 UG 100 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
_gateway 0.0.0.0 255.255.255.255 UH 100 0 0 eth4
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
root@mediasvr:/home/raul# traceroute 192.168.01
traceroute to 192.168.01 (192.168.0.1), 64 hops max
1 192.168.0.1 0.569ms 0.359ms 0.370ms
- I am able to ping/perform traceroute to the gateway which I couldn't before.
- I can perform DNS lookups
- I can ssh into the server remotely via dhcp address
However,
4. I am unable to connect to repositories to get updates
- connect (113: No route to host) Could not connect to archive.ubuntu.com:80 (91.189.88.149).
5. I am unable to connect to the plex media server which is now listening on the dhcp address
tcp 0 0 mediasvr:32400 192.168.0.11:10558 TIME_WAIT
tcp 0 0 mediasvr:49206 mediasvr:32400 ESTABLISHED
@heynnema - Updated yaml file (would you rather continue this in a chat?)
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [192.168.0.1, 208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update - I've applied your suggestion on the yaml changes. It appears that it has improved a couple of things. Specifically;
- I can now ping both eth4 and bond0 internally/externally and the gateway.
- DNS resolution works
- I can SSH into the server
However,
1. Plex uses the first nic it sees which in this case is the dhcp interface
2. I am unable to interact with the internet
UPDATED Yaml file
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses:
- 192.168.0.100/24
#gateway4: 192.168.0.1
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
networking ethernet
New contributor
I am having issues on 18.04 Server when I switch from dhcp to static IP on my device. The reason I was switching is that I was getting a new IP address on my server randomly even though my router had a reserved static IP address for my primary interface (eth0). I switched to static and now I'm having issues resolving /routing to my gateway. My setup has three interfaces (eth0 (primary), eth1, eth3). Don't know what is really causing the issues with the bond0 implementation. Data is moving ok within the network but outside is not and therefore I am unable to update the system unless I swap back to dhcp and live with the randomly changing dhcp address.
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
# primary network card
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0
# second network interface card
auto eth1
iface eth1 inet manual
bond-master bond0
# third network interface card
auto eth3
iface eth3 inet manual
bond-master bond0
# bond0 network interface
auto bond0
iface bond0 inet static
address 192.168.0.100
gateway 192.168.0.1
netmask 255.255.255.0
dns-nameservers 192.168.0.1 208.67.222.222 208.67.220.220
bond_mode 6
bond-miimon 100
bond-slaves none
ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::6ef0:49ff:fe5e:c194 prefixlen 64 scopeid 0x20<link>
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 298900 bytes 19550931 (19.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2089172 bytes 3153193403 (3.1 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c1:94 txqueuelen 1000 (Ethernet)
RX packets 354297 bytes 21749288 (21.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15785 bytes 15597970 (15.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6147<UP,BROADCAST,SLAVE,MULTICAST> mtu 1500
ether 6c:f0:49:5e:c9:95 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth3: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:14:5e:77:45:c6 txqueuelen 1000 (Ethernet)
RX packets 296791 bytes 19306412 (19.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4487992 bytes 6786908424 (6.7 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xfdee0000-fdf00000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 7759 bytes 1630081 (1.6 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7759 bytes 1630081 (1.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
root@mediasvr:/home/xxxx# ping www.cnn.com
ping: www.cnn.com: Temporary failure in name resolution
root@mediasvr:/home/xxxx# nslookup www.cnn.com
;; connection timed out; no servers could be reached
root@mediasvr:/home/xxxx# ping 192.168.0.100
PING 192.168.0.100 (192.168.0.100) 56(84) bytes of data.
64 bytes from 192.168.0.100: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 192.168.0.100: icmp_seq=2 ttl=64 time=0.053 ms
--- 192.168.0.100 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1028ms
rtt min/avg/max/mdev = 0.053/0.056/0.059/0.003 ms
**root@mediasvr:/home/xxxx# ping 192.168.0.1**
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.100 icmp_seq=4 Destination Host Unreachable
From 192.168.0.100 icmp_seq=5 Destination Host Unreachable
From 192.168.0.100 icmp_seq=6 Destination Host Unreachable
From 192.168.0.100 icmp_seq=16 Destination Host Unreachable
From 192.168.0.100 icmp_seq=17 Destination Host Unreachable
From 192.168.0.100 icmp_seq=18 Destination Host Unreachable
From 192.168.0.100 icmp_seq=19 Destination Host Unreachable
From 192.168.0.100 icmp_seq=20 Destination Host Unreachable
--- 192.168.0.1 ping statistics ---
23 packets transmitted, 0 received, +8 errors, 100% packet loss, time 22504ms
root@mediasvr:/home/xxxx# systemd-resolve --status
Global
DNS Servers: 192.168.0.1
208.67.222.222
208.67.220.220
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
Link 8 (bond0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 6 (eth4)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 5 (eth3)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
Link 4 (eth2)
Current Scopes: none
LLMNR setting: yes
I am including the additional information requested.
root@mediasvr:/etc/netplan# cat 50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
bond0:
dhcp4: no
dhcp6: no
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
addresses: [208.67.222.222, 208.67.220.220]
root@mediasvr:/etc/netplan# ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 27 Apr 12 14:40 /etc/resolv.conf -> /run/resolvconf/resolv.conf
root@mediasvr:/etc/netplan# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 208.67.222.222,
nameserver 208.67.220.220
nameserver 127.0.0.53
@heynnema - Update
So I changed both the interface and the .yaml file and applied the netplan without errors (debug) however, I am still having network issues:
- I can ping my interface
- Team bond is fine according to /proc/net/bonding/bond0 (static)
However, - Route command delays to pop up
- Unable to ping the gateway
- Unable to resolve DNS
Here are the updates I performed:
cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#
# loopback
auto lo
iface lo inet loopback
/etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
eth1:
dhcp4: no
eth3:
dhcp4: no
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update (Thank you for your expertise/time. I believe we are getting closer to resolving this problem)
I enabled an extra unused interface and set it to dhcp in the yaml file and applied via netplan. I kept the team bond the same on the existing 3 nics (eth1-eth3)
eth4:
dhcp4: true
optional: true
root@mediasvr:/home/raul# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 0 0 0 bond0
default _gateway 0.0.0.0 UG 100 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
_gateway 0.0.0.0 255.255.255.255 UH 100 0 0 eth4
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
root@mediasvr:/home/raul# traceroute 192.168.01
traceroute to 192.168.01 (192.168.0.1), 64 hops max
1 192.168.0.1 0.569ms 0.359ms 0.370ms
- I am able to ping/perform traceroute to the gateway which I couldn't before.
- I can perform DNS lookups
- I can ssh into the server remotely via dhcp address
However,
4. I am unable to connect to repositories to get updates
- connect (113: No route to host) Could not connect to archive.ubuntu.com:80 (91.189.88.149).
5. I am unable to connect to the plex media server which is now listening on the dhcp address
tcp 0 0 mediasvr:32400 192.168.0.11:10558 TIME_WAIT
tcp 0 0 mediasvr:49206 mediasvr:32400 ESTABLISHED
@heynnema - Updated yaml file (would you rather continue this in a chat?)
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses: [192.168.0.100/24]
gateway4: 192.168.0.1
nameservers:
search: [local]
addresses: [192.168.0.1, 208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
@heynnema - Update - I've applied your suggestion on the yaml changes. It appears that it has improved a couple of things. Specifically;
- I can now ping both eth4 and bond0 internally/externally and the gateway.
- DNS resolution works
- I can SSH into the server
However,
1. Plex uses the first nic it sees which in this case is the dhcp interface
2. I am unable to interact with the internet
UPDATED Yaml file
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
optional: true
eth1:
dhcp4: no
optional: true
eth3:
dhcp4: no
optional: true
eth4:
dhcp4: true
optional: true
bonds:
bond0:
interfaces: [eth0, eth1, eth3]
addresses:
- 192.168.0.100/24
#gateway4: 192.168.0.1
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222, 208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
root@mediasvr:/home/raul# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth4
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 bond0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth4
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 bond0
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth4
networking ethernet
networking ethernet
New contributor
New contributor
edited 5 hours ago
Raul Maldonado
New contributor
asked yesterday
Raul MaldonadoRaul Maldonado
12
12
New contributor
New contributor
Edit your question and show mecat /etc/netplan/*
andls -al /etc/resolv.conf
andcat /etc/resolv.conf
. Report back. Start comments to me with @heynnema
– heynnema
yesterday
@heynnema - I've supplied the additional information you requested
– Raul Maldonado
13 hours ago
You've mixed and matched NetworkManager and netplan scripts at the same time. Netplan is normally used in servers, where the configuration is very static. All of the entries that you added to/etc/network/interfaces
(except for the original 8 lines) need to be deleted, and moved to/etc/netplan/*.yaml
in "netplan-ez" language. See netplan.io/examples for guidance. To pick up the reserved addresses in your router, you must setdhcp4: true
in your .yaml file. And your bond0 must define what interfaces to use.
– heynnema
13 hours ago
@heynnema - I've made the changes to both files, see edits and thanks for the input. I still am having issues
– Raul Maldonado
10 hours ago
A couple of things... in /etc/resolv.conf I see "nameserver 208.67.222.222," and I don't know if it's a typo, but there should not be a trailing ",". How/where are those OpenDNS server addresses coming from? Your .yaml looks good to me. I'd add "optional: true" to eth0/1/3 so there's no boot delay. I'd remove the dhcp reserved address for eth0 from your router. Please explain... which ethX is your WAN? What about eth2? What's on eth1/3, and are those really the ports you want to bond?
– heynnema
10 hours ago
|
show 12 more comments
Edit your question and show mecat /etc/netplan/*
andls -al /etc/resolv.conf
andcat /etc/resolv.conf
. Report back. Start comments to me with @heynnema
– heynnema
yesterday
@heynnema - I've supplied the additional information you requested
– Raul Maldonado
13 hours ago
You've mixed and matched NetworkManager and netplan scripts at the same time. Netplan is normally used in servers, where the configuration is very static. All of the entries that you added to/etc/network/interfaces
(except for the original 8 lines) need to be deleted, and moved to/etc/netplan/*.yaml
in "netplan-ez" language. See netplan.io/examples for guidance. To pick up the reserved addresses in your router, you must setdhcp4: true
in your .yaml file. And your bond0 must define what interfaces to use.
– heynnema
13 hours ago
@heynnema - I've made the changes to both files, see edits and thanks for the input. I still am having issues
– Raul Maldonado
10 hours ago
A couple of things... in /etc/resolv.conf I see "nameserver 208.67.222.222," and I don't know if it's a typo, but there should not be a trailing ",". How/where are those OpenDNS server addresses coming from? Your .yaml looks good to me. I'd add "optional: true" to eth0/1/3 so there's no boot delay. I'd remove the dhcp reserved address for eth0 from your router. Please explain... which ethX is your WAN? What about eth2? What's on eth1/3, and are those really the ports you want to bond?
– heynnema
10 hours ago
Edit your question and show me
cat /etc/netplan/*
and ls -al /etc/resolv.conf
and cat /etc/resolv.conf
. Report back. Start comments to me with @heynnema– heynnema
yesterday
Edit your question and show me
cat /etc/netplan/*
and ls -al /etc/resolv.conf
and cat /etc/resolv.conf
. Report back. Start comments to me with @heynnema– heynnema
yesterday
@heynnema - I've supplied the additional information you requested
– Raul Maldonado
13 hours ago
@heynnema - I've supplied the additional information you requested
– Raul Maldonado
13 hours ago
You've mixed and matched NetworkManager and netplan scripts at the same time. Netplan is normally used in servers, where the configuration is very static. All of the entries that you added to
/etc/network/interfaces
(except for the original 8 lines) need to be deleted, and moved to /etc/netplan/*.yaml
in "netplan-ez" language. See netplan.io/examples for guidance. To pick up the reserved addresses in your router, you must set dhcp4: true
in your .yaml file. And your bond0 must define what interfaces to use.– heynnema
13 hours ago
You've mixed and matched NetworkManager and netplan scripts at the same time. Netplan is normally used in servers, where the configuration is very static. All of the entries that you added to
/etc/network/interfaces
(except for the original 8 lines) need to be deleted, and moved to /etc/netplan/*.yaml
in "netplan-ez" language. See netplan.io/examples for guidance. To pick up the reserved addresses in your router, you must set dhcp4: true
in your .yaml file. And your bond0 must define what interfaces to use.– heynnema
13 hours ago
@heynnema - I've made the changes to both files, see edits and thanks for the input. I still am having issues
– Raul Maldonado
10 hours ago
@heynnema - I've made the changes to both files, see edits and thanks for the input. I still am having issues
– Raul Maldonado
10 hours ago
A couple of things... in /etc/resolv.conf I see "nameserver 208.67.222.222," and I don't know if it's a typo, but there should not be a trailing ",". How/where are those OpenDNS server addresses coming from? Your .yaml looks good to me. I'd add "optional: true" to eth0/1/3 so there's no boot delay. I'd remove the dhcp reserved address for eth0 from your router. Please explain... which ethX is your WAN? What about eth2? What's on eth1/3, and are those really the ports you want to bond?
– heynnema
10 hours ago
A couple of things... in /etc/resolv.conf I see "nameserver 208.67.222.222," and I don't know if it's a typo, but there should not be a trailing ",". How/where are those OpenDNS server addresses coming from? Your .yaml looks good to me. I'd add "optional: true" to eth0/1/3 so there's no boot delay. I'd remove the dhcp reserved address for eth0 from your router. Please explain... which ethX is your WAN? What about eth2? What's on eth1/3, and are those really the ports you want to bond?
– heynnema
10 hours ago
|
show 12 more comments
2 Answers
2
active
oldest
votes
I have found that in Ubuntu Server 18.04, there is a new way to communicate w/ exterior connections. If you look in /etc/netplan/, there will be a file called 50-cloud-init.yaml.
This is the file, supposedly, that needs to be altered to work w/ static ip addresses. I actually posted a familiar question and there was this fellow that helped out. See here: RE: Getting Ubuntu Server to Show Web Page URL instead of Just my IP Address.
...
If this helps, this is a good notation to make. I also found some similar instances on this site that are dedicated to the server side of Ubuntu.
Seth
P.S. I do not have a 100% cure for this static ip issue yet but my page is up and running w/ "Port Forward" on my router as of now. I actually tried to change out my .yaml file, the file I described earlier in /etc/netplan/, w/out satisfaction. Look to netplan(5) for starter info. and a good set of conclusions on the daemon. Also, w/ this being a resort, you can get a third party like no-ip to host your static ip for you if this is too large of an issue.
...
So,
For Static IP Addresses: Use your favorite editor w/ the file /etc/netplan/50-cloud-init.yaml or use a third party like no-ip.com.
For setting up your DNS: Use bind9, e.g. sudo apt install bind9. You have to uncomment your file at /etc/bind/named.conf.options and set your IP:
forwarders {
8.8.8.8;
8.8.4.4;
};
I have been reading out of Lacroix's book, "Mastering Ubuntu Server." It is dedicated to the new release of Ubuntu Server during specific sections.
Anyway...the above code should not be commented and it, as is, is directed at google's DNS servers. You can point them to your ISP's DNS servers too.
Now...restart the bind service w/ sudo systemctl restart bind9
.
Let me know if this is clear or too muddy. I will try to make sense out of your situation more as time persists. Please let me know if this supports you cause.
Oh! Are you using a router and access point for your server or just a router?
To make a gateway w/ an access point and router, use this command:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
I got that command from the book, too.
Now, to make that command work after reboots, go to the file, /etc/sysctl.conf, to change things. Use this change.
#net.ipv4.ip_forward=1
to:
net.ipv4.ip_forward=1
Just uncomment out the hash mark.
This should stop the reboot from cancelling out your server w/ Ubuntu Server.
New contributor
askubuntu.com/questions/900523/…
– De Funct
yesterday
add a comment |
I'm assuming that eth0 is your WAN connection
I'm not bonding 3 interfaces in my .yamllet eth0 pick up any IP address via dhcp4 for right now
we can set a router reserved address for eth0 later...
sudo lshw -C network
orifconfig
orip addr
# identify proper MAC for eth0- set router reserved dhcp using that MAC, and the desired IP
some tweaking will be required along the way
sudo netplan --debug generate
# generate config files
sudo netplan apply
# apply new configuration
reboot
# and verify proper operation
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
eth1:
dhcp4: false
optional: true
eth3:
dhcp4: false
optional: true
eth4:
dhcp4: false
optional: true
bonds:
bond0:
interfaces: [eth1,eth3,eth4]
addresses: [192.168.0.100/24]
#gateway4: 192.168.0.1 # not used with routes
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222,208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Raul Maldonado is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1133395%2frouting-dns-resolution-with-bond0%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have found that in Ubuntu Server 18.04, there is a new way to communicate w/ exterior connections. If you look in /etc/netplan/, there will be a file called 50-cloud-init.yaml.
This is the file, supposedly, that needs to be altered to work w/ static ip addresses. I actually posted a familiar question and there was this fellow that helped out. See here: RE: Getting Ubuntu Server to Show Web Page URL instead of Just my IP Address.
...
If this helps, this is a good notation to make. I also found some similar instances on this site that are dedicated to the server side of Ubuntu.
Seth
P.S. I do not have a 100% cure for this static ip issue yet but my page is up and running w/ "Port Forward" on my router as of now. I actually tried to change out my .yaml file, the file I described earlier in /etc/netplan/, w/out satisfaction. Look to netplan(5) for starter info. and a good set of conclusions on the daemon. Also, w/ this being a resort, you can get a third party like no-ip to host your static ip for you if this is too large of an issue.
...
So,
For Static IP Addresses: Use your favorite editor w/ the file /etc/netplan/50-cloud-init.yaml or use a third party like no-ip.com.
For setting up your DNS: Use bind9, e.g. sudo apt install bind9. You have to uncomment your file at /etc/bind/named.conf.options and set your IP:
forwarders {
8.8.8.8;
8.8.4.4;
};
I have been reading out of Lacroix's book, "Mastering Ubuntu Server." It is dedicated to the new release of Ubuntu Server during specific sections.
Anyway...the above code should not be commented and it, as is, is directed at google's DNS servers. You can point them to your ISP's DNS servers too.
Now...restart the bind service w/ sudo systemctl restart bind9
.
Let me know if this is clear or too muddy. I will try to make sense out of your situation more as time persists. Please let me know if this supports you cause.
Oh! Are you using a router and access point for your server or just a router?
To make a gateway w/ an access point and router, use this command:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
I got that command from the book, too.
Now, to make that command work after reboots, go to the file, /etc/sysctl.conf, to change things. Use this change.
#net.ipv4.ip_forward=1
to:
net.ipv4.ip_forward=1
Just uncomment out the hash mark.
This should stop the reboot from cancelling out your server w/ Ubuntu Server.
New contributor
askubuntu.com/questions/900523/…
– De Funct
yesterday
add a comment |
I have found that in Ubuntu Server 18.04, there is a new way to communicate w/ exterior connections. If you look in /etc/netplan/, there will be a file called 50-cloud-init.yaml.
This is the file, supposedly, that needs to be altered to work w/ static ip addresses. I actually posted a familiar question and there was this fellow that helped out. See here: RE: Getting Ubuntu Server to Show Web Page URL instead of Just my IP Address.
...
If this helps, this is a good notation to make. I also found some similar instances on this site that are dedicated to the server side of Ubuntu.
Seth
P.S. I do not have a 100% cure for this static ip issue yet but my page is up and running w/ "Port Forward" on my router as of now. I actually tried to change out my .yaml file, the file I described earlier in /etc/netplan/, w/out satisfaction. Look to netplan(5) for starter info. and a good set of conclusions on the daemon. Also, w/ this being a resort, you can get a third party like no-ip to host your static ip for you if this is too large of an issue.
...
So,
For Static IP Addresses: Use your favorite editor w/ the file /etc/netplan/50-cloud-init.yaml or use a third party like no-ip.com.
For setting up your DNS: Use bind9, e.g. sudo apt install bind9. You have to uncomment your file at /etc/bind/named.conf.options and set your IP:
forwarders {
8.8.8.8;
8.8.4.4;
};
I have been reading out of Lacroix's book, "Mastering Ubuntu Server." It is dedicated to the new release of Ubuntu Server during specific sections.
Anyway...the above code should not be commented and it, as is, is directed at google's DNS servers. You can point them to your ISP's DNS servers too.
Now...restart the bind service w/ sudo systemctl restart bind9
.
Let me know if this is clear or too muddy. I will try to make sense out of your situation more as time persists. Please let me know if this supports you cause.
Oh! Are you using a router and access point for your server or just a router?
To make a gateway w/ an access point and router, use this command:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
I got that command from the book, too.
Now, to make that command work after reboots, go to the file, /etc/sysctl.conf, to change things. Use this change.
#net.ipv4.ip_forward=1
to:
net.ipv4.ip_forward=1
Just uncomment out the hash mark.
This should stop the reboot from cancelling out your server w/ Ubuntu Server.
New contributor
askubuntu.com/questions/900523/…
– De Funct
yesterday
add a comment |
I have found that in Ubuntu Server 18.04, there is a new way to communicate w/ exterior connections. If you look in /etc/netplan/, there will be a file called 50-cloud-init.yaml.
This is the file, supposedly, that needs to be altered to work w/ static ip addresses. I actually posted a familiar question and there was this fellow that helped out. See here: RE: Getting Ubuntu Server to Show Web Page URL instead of Just my IP Address.
...
If this helps, this is a good notation to make. I also found some similar instances on this site that are dedicated to the server side of Ubuntu.
Seth
P.S. I do not have a 100% cure for this static ip issue yet but my page is up and running w/ "Port Forward" on my router as of now. I actually tried to change out my .yaml file, the file I described earlier in /etc/netplan/, w/out satisfaction. Look to netplan(5) for starter info. and a good set of conclusions on the daemon. Also, w/ this being a resort, you can get a third party like no-ip to host your static ip for you if this is too large of an issue.
...
So,
For Static IP Addresses: Use your favorite editor w/ the file /etc/netplan/50-cloud-init.yaml or use a third party like no-ip.com.
For setting up your DNS: Use bind9, e.g. sudo apt install bind9. You have to uncomment your file at /etc/bind/named.conf.options and set your IP:
forwarders {
8.8.8.8;
8.8.4.4;
};
I have been reading out of Lacroix's book, "Mastering Ubuntu Server." It is dedicated to the new release of Ubuntu Server during specific sections.
Anyway...the above code should not be commented and it, as is, is directed at google's DNS servers. You can point them to your ISP's DNS servers too.
Now...restart the bind service w/ sudo systemctl restart bind9
.
Let me know if this is clear or too muddy. I will try to make sense out of your situation more as time persists. Please let me know if this supports you cause.
Oh! Are you using a router and access point for your server or just a router?
To make a gateway w/ an access point and router, use this command:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
I got that command from the book, too.
Now, to make that command work after reboots, go to the file, /etc/sysctl.conf, to change things. Use this change.
#net.ipv4.ip_forward=1
to:
net.ipv4.ip_forward=1
Just uncomment out the hash mark.
This should stop the reboot from cancelling out your server w/ Ubuntu Server.
New contributor
I have found that in Ubuntu Server 18.04, there is a new way to communicate w/ exterior connections. If you look in /etc/netplan/, there will be a file called 50-cloud-init.yaml.
This is the file, supposedly, that needs to be altered to work w/ static ip addresses. I actually posted a familiar question and there was this fellow that helped out. See here: RE: Getting Ubuntu Server to Show Web Page URL instead of Just my IP Address.
...
If this helps, this is a good notation to make. I also found some similar instances on this site that are dedicated to the server side of Ubuntu.
Seth
P.S. I do not have a 100% cure for this static ip issue yet but my page is up and running w/ "Port Forward" on my router as of now. I actually tried to change out my .yaml file, the file I described earlier in /etc/netplan/, w/out satisfaction. Look to netplan(5) for starter info. and a good set of conclusions on the daemon. Also, w/ this being a resort, you can get a third party like no-ip to host your static ip for you if this is too large of an issue.
...
So,
For Static IP Addresses: Use your favorite editor w/ the file /etc/netplan/50-cloud-init.yaml or use a third party like no-ip.com.
For setting up your DNS: Use bind9, e.g. sudo apt install bind9. You have to uncomment your file at /etc/bind/named.conf.options and set your IP:
forwarders {
8.8.8.8;
8.8.4.4;
};
I have been reading out of Lacroix's book, "Mastering Ubuntu Server." It is dedicated to the new release of Ubuntu Server during specific sections.
Anyway...the above code should not be commented and it, as is, is directed at google's DNS servers. You can point them to your ISP's DNS servers too.
Now...restart the bind service w/ sudo systemctl restart bind9
.
Let me know if this is clear or too muddy. I will try to make sense out of your situation more as time persists. Please let me know if this supports you cause.
Oh! Are you using a router and access point for your server or just a router?
To make a gateway w/ an access point and router, use this command:
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
I got that command from the book, too.
Now, to make that command work after reboots, go to the file, /etc/sysctl.conf, to change things. Use this change.
#net.ipv4.ip_forward=1
to:
net.ipv4.ip_forward=1
Just uncomment out the hash mark.
This should stop the reboot from cancelling out your server w/ Ubuntu Server.
New contributor
New contributor
answered yesterday
De FunctDe Funct
186
186
New contributor
New contributor
askubuntu.com/questions/900523/…
– De Funct
yesterday
add a comment |
askubuntu.com/questions/900523/…
– De Funct
yesterday
askubuntu.com/questions/900523/…
– De Funct
yesterday
askubuntu.com/questions/900523/…
– De Funct
yesterday
add a comment |
I'm assuming that eth0 is your WAN connection
I'm not bonding 3 interfaces in my .yamllet eth0 pick up any IP address via dhcp4 for right now
we can set a router reserved address for eth0 later...
sudo lshw -C network
orifconfig
orip addr
# identify proper MAC for eth0- set router reserved dhcp using that MAC, and the desired IP
some tweaking will be required along the way
sudo netplan --debug generate
# generate config files
sudo netplan apply
# apply new configuration
reboot
# and verify proper operation
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
eth1:
dhcp4: false
optional: true
eth3:
dhcp4: false
optional: true
eth4:
dhcp4: false
optional: true
bonds:
bond0:
interfaces: [eth1,eth3,eth4]
addresses: [192.168.0.100/24]
#gateway4: 192.168.0.1 # not used with routes
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222,208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
add a comment |
I'm assuming that eth0 is your WAN connection
I'm not bonding 3 interfaces in my .yamllet eth0 pick up any IP address via dhcp4 for right now
we can set a router reserved address for eth0 later...
sudo lshw -C network
orifconfig
orip addr
# identify proper MAC for eth0- set router reserved dhcp using that MAC, and the desired IP
some tweaking will be required along the way
sudo netplan --debug generate
# generate config files
sudo netplan apply
# apply new configuration
reboot
# and verify proper operation
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
eth1:
dhcp4: false
optional: true
eth3:
dhcp4: false
optional: true
eth4:
dhcp4: false
optional: true
bonds:
bond0:
interfaces: [eth1,eth3,eth4]
addresses: [192.168.0.100/24]
#gateway4: 192.168.0.1 # not used with routes
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222,208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
add a comment |
I'm assuming that eth0 is your WAN connection
I'm not bonding 3 interfaces in my .yamllet eth0 pick up any IP address via dhcp4 for right now
we can set a router reserved address for eth0 later...
sudo lshw -C network
orifconfig
orip addr
# identify proper MAC for eth0- set router reserved dhcp using that MAC, and the desired IP
some tweaking will be required along the way
sudo netplan --debug generate
# generate config files
sudo netplan apply
# apply new configuration
reboot
# and verify proper operation
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
eth1:
dhcp4: false
optional: true
eth3:
dhcp4: false
optional: true
eth4:
dhcp4: false
optional: true
bonds:
bond0:
interfaces: [eth1,eth3,eth4]
addresses: [192.168.0.100/24]
#gateway4: 192.168.0.1 # not used with routes
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222,208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
I'm assuming that eth0 is your WAN connection
I'm not bonding 3 interfaces in my .yamllet eth0 pick up any IP address via dhcp4 for right now
we can set a router reserved address for eth0 later...
sudo lshw -C network
orifconfig
orip addr
# identify proper MAC for eth0- set router reserved dhcp using that MAC, and the desired IP
some tweaking will be required along the way
sudo netplan --debug generate
# generate config files
sudo netplan apply
# apply new configuration
reboot
# and verify proper operation
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
eth1:
dhcp4: false
optional: true
eth3:
dhcp4: false
optional: true
eth4:
dhcp4: false
optional: true
bonds:
bond0:
interfaces: [eth1,eth3,eth4]
addresses: [192.168.0.100/24]
#gateway4: 192.168.0.1 # not used with routes
routes:
- to: 0.0.0.0/0
via: 192.168.0.1
metric: 100
nameservers:
search: [local]
addresses: [208.67.222.222,208.67.220.220]
parameters:
mode: balance-alb
mii-monitor-interval: 1
gratuitious-arp: 5
edited 4 hours ago
answered 9 hours ago
heynnemaheynnema
21.6k32361
21.6k32361
add a comment |
add a comment |
Raul Maldonado is a new contributor. Be nice, and check out our Code of Conduct.
Raul Maldonado is a new contributor. Be nice, and check out our Code of Conduct.
Raul Maldonado is a new contributor. Be nice, and check out our Code of Conduct.
Raul Maldonado is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1133395%2frouting-dns-resolution-with-bond0%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Edit your question and show me
cat /etc/netplan/*
andls -al /etc/resolv.conf
andcat /etc/resolv.conf
. Report back. Start comments to me with @heynnema– heynnema
yesterday
@heynnema - I've supplied the additional information you requested
– Raul Maldonado
13 hours ago
You've mixed and matched NetworkManager and netplan scripts at the same time. Netplan is normally used in servers, where the configuration is very static. All of the entries that you added to
/etc/network/interfaces
(except for the original 8 lines) need to be deleted, and moved to/etc/netplan/*.yaml
in "netplan-ez" language. See netplan.io/examples for guidance. To pick up the reserved addresses in your router, you must setdhcp4: true
in your .yaml file. And your bond0 must define what interfaces to use.– heynnema
13 hours ago
@heynnema - I've made the changes to both files, see edits and thanks for the input. I still am having issues
– Raul Maldonado
10 hours ago
A couple of things... in /etc/resolv.conf I see "nameserver 208.67.222.222," and I don't know if it's a typo, but there should not be a trailing ",". How/where are those OpenDNS server addresses coming from? Your .yaml looks good to me. I'd add "optional: true" to eth0/1/3 so there's no boot delay. I'd remove the dhcp reserved address for eth0 from your router. Please explain... which ethX is your WAN? What about eth2? What's on eth1/3, and are those really the ports you want to bond?
– heynnema
10 hours ago