Unable to start PSQL in DigitalOcean - database

I am unable to connect to PSql from my DigitalOcean server. This happened after resizing the droplet.
listen_addresses = '*' added to postgresql.conf
host all all 0.0.0.0/0 md5 added to pg_hba.conf
netstat -nlp displays the following:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1705/redis-server 1
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 23688/unicorn.conf
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1693/nginx
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1390/sshd
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1693/nginx
tcp6 0 0 :::22 :::* LISTEN 1390/sshd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 10806 1173/dbus-daemon /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 711 1213/systemd /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 11921 1213/systemd /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 11924 1213/systemd /run/snapd.socket
unix 2 [ ACC ] STREAM LISTENING 11925 1213/systemd /run/snapd-snap.socket
unix 2 [ ACC ] STREAM LISTENING 2813 1449/acpid /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 9801 1/init #/com/ubuntu/upstart
unix 2 [ ACC ] SEQPACKET LISTENING 427 708/systemd-udevd /run/udev/control

Related

unable to connect on localhost:3000 from browser

I created a docker app to run a react application to run on localhost port 3000. Suddenly I am seeing that it is not running; what I have seen in Netstat is that it is time-wait.
This is the output I got after running netstat -plant:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 172.18.0.1:5025 0.0.0.0:* LISTEN 32384/qbittorrent
tcp 0 0 172.16.100.1:5025 0.0.0.0:* LISTEN 32384/qbittorrent
tcp 0 0 192.168.233.1:5025 0.0.0.0:* LISTEN 32384/qbittorrent
tcp 0 0 172.17.0.1:5025 0.0.0.0:* LISTEN 32384/qbittorrent
tcp 0 0 192.168.31.46:5025 0.0.0.0:* LISTEN 32384/qbittorrent
tcp 0 0 127.0.0.1:5025 0.0.0.0:* LISTEN 32384/qbittorrent
tcp 0 0 0.0.0.0:37925 0.0.0.0:* LISTEN 1924/rpc.statd
tcp 0 0 0.0.0.0:902 0.0.0.0:* LISTEN 8526/vmware-authdla
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 3302/smbd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1909/rpcbind
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 36678/docker-proxy
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2758/cupsd
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 39955/docker-proxy
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 3302/smbd
tcp 0 0 0.0.0.0:7070 0.0.0.0:* LISTEN 2333/anydesk
tcp 0 0 192.168.31.46:59416 151.101.193.69:443 ESTABLISHED 41671/opera --type=
tcp 78 0 192.168.31.46:43086 34.215.76.123:443 CLOSE_WAIT 33791/chrome --type
tcp 0 0 192.168.31.46:37940 157.240.15.17:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:40770 142.250.195.66:443 ESTABLISHED 33791/chrome --type
tcp 0 0 127.0.0.1:55552 127.0.0.1:8080 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:38084 157.240.15.17:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:48400 142.250.196.164:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:40690 52.111.252.2:443 ESTABLISHED 41671/opera --type=
tcp 0 1 172.18.0.1:48992 172.18.0.2:3000 SYN_SENT 39955/docker-proxy
tcp 0 0 192.168.31.46:44748 52.111.252.0:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:37930 157.240.15.17:443 ESTABLISHED 41671/opera --type=
tcp 0 0 127.0.0.1:3000 127.0.0.1:47782 ESTABLISHED 39955/docker-proxy
tcp 0 0 127.0.0.1:47782 127.0.0.1:3000 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:48900 110.76.130.81:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:60481 52.163.231.110:443 ESTABLISHED 32695/skypeforlinux
tcp 1 0 192.168.31.46:50192 107.167.110.223:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:45422 20.185.212.106:443 ESTABLISHED 32684/skypeforlinux
tcp 0 0 192.168.31.46:39872 142.251.10.188:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:45756 142.250.182.38:443 ESTABLISHED 33791/chrome --type
tcp 25 0 192.168.31.46:60728 103.83.123.88:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:60486 13.33.28.118:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:55874 216.58.196.162:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:36654 104.18.99.194:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:49272 157.240.15.1:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:60730 103.83.123.88:443 CLOSE_WAIT 41671/opera --type=
tcp 1 0 192.168.31.46:45328 104.18.11.39:80 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:37192 110.76.130.136:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:59506 13.107.6.171:443 ESTABLISHED 41671/opera --type=
tcp 0 0 127.0.0.1:3000 127.0.0.1:47772 ESTABLISHED 39955/docker-proxy
tcp 0 0 192.168.31.46:52622 13.76.217.211:443 ESTABLISHED 32684/skypeforlinux
tcp 0 0 192.168.31.46:59386 13.107.6.171:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:33478 103.229.10.173:443 ESTABLISHED 33791/chrome --type
tcp 0 0 127.0.0.1:47772 127.0.0.1:3000 ESTABLISHED 33791/chrome --type
tcp 0 1 172.18.0.1:48984 172.18.0.2:3000 SYN_SENT 39955/docker-proxy
tcp 0 0 127.0.0.1:47770 127.0.0.1:3000 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:38176 157.240.15.17:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:55340 199.232.253.140:443 ESTABLISHED 33791/chrome --type
tcp 32 0 192.168.31.46:52344 18.205.51.212:443 CLOSE_WAIT 33791/chrome --type
tcp 0 0 192.168.31.46:40662 52.111.252.2:443 ESTABLISHED 41671/opera --type=
tcp 674 0 127.0.0.1:3000 127.0.0.1:47770 ESTABLISHED 39955/docker-proxy
tcp 0 0 127.0.0.1:8080 127.0.0.1:55552 ESTABLISHED 36678/docker-proxy
tcp 0 0 192.168.31.46:51660 151.101.129.69:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:45420 20.185.212.106:443 ESTABLISHED 32684/skypeforlinux
tcp 0 0 192.168.31.46:60732 103.83.123.88:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 172.17.0.1:50214 172.17.0.3:80 ESTABLISHED 36678/docker-proxy
tcp 0 0 192.168.31.46:37482 107.167.110.216:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:47592 13.227.214.108:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:46436 108.174.11.37:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:44592 142.250.182.130:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:52876 74.125.68.188:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:55978 151.101.129.140:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:42314 142.250.76.72:443 ESTABLISHED 33791/chrome --type
tcp 25 0 192.168.31.46:50150 107.167.110.223:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:55478 75.2.53.94:443 ESTABLISHED 41671/opera --type=
tcp 25 0 192.168.31.46:37490 107.167.110.216:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:46432 108.174.11.37:443 ESTABLISHED 33791/chrome --type
tcp 25 0 192.168.31.46:52600 185.26.182.118:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:60420 192.229.232.200:443 ESTABLISHED 32684/skypeforlinux
tcp 0 0 192.168.31.46:34998 140.82.112.25:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:50030 52.109.124.33:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:48532 13.107.21.200:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:46420 108.174.11.37:443 ESTABLISHED 33791/chrome --type
tcp 25 0 192.168.31.46:60734 103.83.123.88:443 CLOSE_WAIT 41671/opera --type=
tcp 0 1 172.18.0.1:48982 172.18.0.2:3000 SYN_SENT 39955/docker-proxy
tcp 0 0 192.168.31.46:33593 46.4.60.45:80 ESTABLISHED 2333/anydesk
tcp 0 0 192.168.31.46:33932 142.250.193.163:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:59020 198.252.206.25:443 ESTABLISHED 41671/opera --type=
tcp 25 0 192.168.31.46:41286 107.167.110.211:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:42886 151.101.36.193:443 ESTABLISHED 41671/opera --type=
tcp 1 0 192.168.31.46:37442 13.67.9.5:443 CLOSE_WAIT 40378/code --type=u
tcp 0 0 192.168.31.46:38106 157.240.15.17:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:58954 198.252.206.25:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:53582 151.101.1.2:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:39822 52.111.240.2:443 ESTABLISHED 41671/opera --type=
tcp 1 0 192.168.31.46:52360 18.205.51.212:443 CLOSE_WAIT 33791/chrome --type
tcp 25 0 192.168.31.46:34720 185.26.182.123:443 CLOSE_WAIT 41671/opera --type=
tcp 0 0 192.168.31.46:50378 151.101.1.26:443 ESTABLISHED 33791/chrome --type
tcp 0 0 192.168.31.46:38088 157.240.15.17:443 ESTABLISHED 41671/opera --type=
tcp 0 0 192.168.31.46:50008 52.109.124.33:443 ESTABLISHED 41671/opera --type=
tcp 0 1 172.17.0.1:50114 172.17.0.3:80 LAST_ACK -
tcp6 0 0 :::49631 :::* LISTEN 1924/rpc.statd
tcp6 0 0 fe80::109a:16ff:fe:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 fe80::88ab:42ff:fe:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 fe80::42:5ff:fe96::5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 fe80::f76b:88d5:d4:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 fe80::9472:48ff:fe:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 fe80::250:56ff:fec:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 fe80::250:56ff:fec:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 fe80::42:46ff:fe1a:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 ::1:5025 :::* LISTEN 32384/qbittorrent
tcp6 0 0 :::902 :::* LISTEN 8526/vmware-authdla
tcp6 0 0 :::6566 :::* LISTEN 2759/saned
tcp6 0 0 :::5000 :::* LISTEN 2453/docker-registr
tcp6 0 0 :::139 :::* LISTEN 3302/smbd
tcp6 0 0 :::111 :::* LISTEN 1909/rpcbind
tcp6 0 0 ::1:631 :::* LISTEN 2758/cupsd
tcp6 0 0 :::445 :::* LISTEN 3302/smbd
tcp6 1 0 ::1:58816 ::1:631 CLOSE_WAIT 2752/cups-browsed
tcp6 1 0 ::1:58814 ::1:631 CLOSE_WAIT 2752/cups-browsed
It can be seen that the docker proxy connection has been established on port 3000. But the browser cannot access it. What can be the reasons behind this issue?

WireGuard: can't ping anything, traffic doesn't go through while handshake successful

I'm trying to setup WireGuard VPN server on a cloud virtual server (Yandex cloud).
Server config:
[Interface]
Address = 10.128.0.19/24
MTU = 1500
SaveConfig = false
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t >
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables ->
ListenPort = 41820
PrivateKey = <cut>
[Peer]
PublicKey = 0fWTvnU+j4D4pXfv0hWtAJDatRj/DxgPH3zwrSbT7js=
AllowedIPs = 10.128.0.201/32
Client config:
[Interface]
PrivateKey = <cut>
Address = 10.128.0.200/32
DNS = 1.1.1.1, 1.0.0.1
[Peer]
PublicKey = g9HF8K1303CwDrYb0ga8/dBe8EY8tb3wlreO0lHA9iI=
AllowedIPs = 0.0.0.0/0
Endpoint = <cut>:41820
PersistentKeepalive = 25
I've enabled the net.ipv4.ip_forward=1 option on the server. The server is on the public cloud compute instance. The client is an Android device in a home network behind NAT.
When I turn on the tunnel, all the communications stops. I can't ping anything from the device. At the same time, I can see successful handshakes in the wg output:
interface: wg0
public key: g9HF8K1303CwDrYb0ga8/dBe8EY8tb3wlreO0lHA9iI=
private key: (hidden)
listening port: 41820
peer: 0fWTvnU+j4D4pXfv0hWtAJDatRj/DxgPH3zwrSbT7js=
endpoint: <cut>:38517
allowed ips: 10.128.0.201/32
latest handshake: 15 seconds ago
transfer: 2.25 KiB received, 124 B sent
I can't ping neither the VPN server internal IP address (10.128.0.19) nor any of public IPs (like 1.1.1.1).
The server's ifconfig output is the following:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.128.0.19 netmask 255.255.255.0 broadcast 10.128.0.255
inet6 fe80::d20d:1bff:fe98:a801 prefixlen 64 scopeid 0x20<link>
ether d0:0d:1b:98:a8:01 txqueuelen 1000 (Ethernet)
RX packets 16530 bytes 2016056 (2.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12031 bytes 1483606 (1.4 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
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 177 bytes 14328 (14.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 177 bytes 14328 (14.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wg0: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet 10.128.0.19 netmask 255.255.255.0 destination 10.128.0.19
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 145 bytes 16504 (16.5 KB)
RX errors 54 dropped 0 overruns 0 frame 54
TX packets 11 bytes 472 (472.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
The OS on the server is Ubuntu 20.04.
I tried to set MTU on the client side to 1500 but nothing changed.
What I'm doing wrong?
The issue was in the server's interface IP address. The correct one is
[Interface]
Address = 10.128.0.19/32
The subnet part should be 32 instead of 24 in my case.
After that, the connection works well.
The allowed ip is wrong in the server configuration.
Please change it from:
[Peer]
PublicKey = 0fWTvnU+j4D4pXfv0hWtAJDatRj/DxgPH3zwrSbT7js=
AllowedIPs = 10.128.0.201/32
to:
[Peer]
PublicKey = 0fWTvnU+j4D4pXfv0hWtAJDatRj/DxgPH3zwrSbT7js=
AllowedIPs = 10.128.0.200/32

Problems with load balancing and nginx gcp

I am trying to use gcp to host my back end rest api. I have created successfully a vm instsnce ubuntu debian 9 , configured the firewall rules vpc network and now I have to to "make" it listen to some ports, in order the vm instance to accept requests from adresses. I followed the tutorials here: https://geekflare.com/gcp-load-balancer/ and https://www.scaleway.com/en/docs/how-to-configure-nginx-reverse-proxy/ , but neither of them works for me. Using load balancing and running the netstat -l in shh terimal , I get this :
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 0.0.0.0:bootpc 0.0.0.0:*
udp 0 0 instance-group-2-ff:ntp 0.0.0.0:*
udp 0 0 localhost:ntp 0.0.0.0:*
udp 0 0 0.0.0.0:ntp 0.0.0.0:*
udp6 0 0 fe80::4001:aff:fea6:ntp [::]:*
udp6 0 0 localhost:ntp [::]:*
udp6 0 0 [::]:ntp [::]:*
and
from nginx :
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 0.0.0.0:bootpc 0.0.0.0:*
udp 0 0 instance-group-for-:ntp 0.0.0.0:*
udp 0 0 localhost:ntp 0.0.0.0:*
udp 0 0 0.0.0.0:ntp 0.0.0.0:*
udp6 0 0 fe80::4001:aff:fea6:ntp [::]:*
udp6 0 0 localhost:ntp [::]:*
udp6 0 0 [::]:ntp [::]:*
and when writing the external ip on web browser : 502 Bad Gateway nginx/1.10.3
The reverse-proxy.conf is :
server {
listen 80;
listen [::]:80;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
location / {
proxy_pass http://external:80;
}
}
I also tested nginx and everything is ok.
Do you know maybe what is wrong? Any help would be really appreciated

Access to USB Ethernet adapter in LXC

I've created a LXC container in Ubuntu 18.04. Physically, there is an USB to Ethernet adapter connected on the host machine. After starting the LXC container, how to access the USB ethernet adapter? Are there configurations for LXC to do?
The info on the Host machine:
rui#rui-desktop:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::f763:92fe:8145:163 prefixlen 64 scopeid 0x20<link>
ether 00:0e:c6:c9:1a:18 txqueuelen 1000 (Ethernet)
RX packets 1 bytes 46 (46.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 158 bytes 29470 (29.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1430
inet 173.39.202.159 netmask 255.255.255.128 broadcast 173.39.202.255
inet6 fe80::2e0:4cff:fe68:12c prefixlen 64 scopeid 0x20<link>
ether 00:e0:4c:68:01:2c txqueuelen 1000 (Ethernet)
RX packets 1911906 bytes 851840909 (851.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 350546 bytes 25613552 (25.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 149 base 0xd000
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 1 (Local Loopback)
RX packets 35420 bytes 2918763 (2.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35420 bytes 2918763 (2.9 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lxcbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 10.0.3.1 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::216:3eff:fe00:0 prefixlen 64 scopeid 0x20<link>
ether 00:16:3e:00:00:00 txqueuelen 1000 (Ethernet)
RX packets 859 bytes 86124 (86.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 831 bytes 88890 (88.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
rndis0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether be:86:e5:ee:9a:ed 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
usb0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether be:86:e5:ee:9a:ef 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
eth0 is the interface that I want to access, and the output from lsusb is
rui#rui-desktop:~$ lsusb
Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
**Bus 001 Device 015: ID 0b95:7720 ASIX Electronics Corp. AX88772**
Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
LXC container info:
Last login: Sat Feb 24 17:40:28 UTC 2018 on pts/0
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.9.140-tegra aarch64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
cisco#ul:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
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
40: eth0#if41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:d6:9b:38 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.0.3.194/24 brd 10.0.3.255 scope global dynamic eth0
valid_lft 3586sec preferred_lft 3586sec
inet6 fe80::216:3eff:fed6:9b38/64 scope link
valid_lft forever preferred_lft forever
Adding these setting in /var/lib/lxc/ul/config make it working.
lxc.net.1.type = phys
lxc.net.1.link = eth0
lxc.net.1.flags = up
lxc.net.1.hwaddr = 00:0e:c6:c9:1a:18

Wired Connection not working in Ubuntu 18.04

Wired connection was not identified by Ubuntu.
Here's my result if I run ifconfig -a on terminal
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 308 bytes 22700 (22.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 308 bytes 22700 (22.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.42.0.249 netmask 255.255.255.0 broadcast 10.42.0.255
inet6 fe80::a78:589e:2107:b3c4 prefixlen 64 scopeid 0x20<link>
ether dc:53:60:e2:ce:99 txqueuelen 1000 (Ethernet)
RX packets 13416 bytes 9588247 (9.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9109 bytes 1698278 (1.6 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Help me to get out of this
Thanks in Advance :)
The following helped me (I'm not quite sure why, but it did! :D)
Check ethernet state with
$ nmcli device
Check if there are errors or warnings from NetworkManager
$ systemctl status NetworkManager.service
Go root:
$ sudo -s
Delete all files in the directory /var/lib/NetworkManager/ except secret_key
$ cd /var/lib/NetworkManager/
$ rm -v !("secret_key")
Now reboot system and check ethernet state with nmcli device
If that does not help, you can create an empty file with this command and restart the computer again.
sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
Source: https://forum.ubuntuusers.de/topic/kein-netzzugriff/

Resources