Can ping gateway linux

Ubuntu server 16.04 can’t ping outside IP’s or domains or do updates

I moved my server to my work and setup everything.
Changed the Internal IP to a new on and also changed the static IP to a new one.
When I do a ifconfig the new IP address/default-gateway/subnet all show as correctly.
The problem is I can’t access the server through any pc on the network, can’t ping any domain or external IP, can’t do a apt-get anything, I added new rules to the firewall I am using now(mikrotike router/firwall) allowed port 80 and also pointed the new static IP to my domain company used(onlydomains.com). I also restarted apache2, the actual server and even router.
I can only ping internal IP’s only. I checked out many posts and google and was told to check:

/etc/resolve.conf
/etc/network/interfaces
/etc/gai.conf (uncomment. precedence::ffff:0:0/96 100) to get apt-get working
also flush ip setting

When the server was by my home everything worked perfectly. I could access the website, ssh into the server from anywhere and so on. I am so confused and don’t know what needs to be done in order to fix it. *If this has been solved somewhere please direct me there. Thanks Update: ip route output:

default via 192.168.1.254 dev eno1 onlink 
192.168.11.0/24 dev eno1 proto kernel scope link src 192.168.11.199

changes made in /etc/network/interfaces = I changed the network/broadcast/gateway as these were outside the range of the IP Address. Can reach the server via SSH and can ping the default gateway however I can’t ping any domain only IP’s on the network. Also can’t do any apt-get’s. dig google.com ======

; > Dig 9.10.3-P4-Ubuntu > google.com 
;; global options: +cmd
;; connection timed out; no servers could be reached
nameserver 41.xxx.0.36 
nameserver 41.xxx.0.37
search website.com
dig google.com @8.8.8.8
;> DiG 9.10.3-P4-Ubuntu > google.com @8.8.8.8 
;; global options: +cmd
;; Got answer:
;; ->>HEADER ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com IN A
;; ANSWER SECTION:
google.com. 192 IN A 216.58.223.46
;; QUERY time: 104 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Apr 13 10:22:42 SAST 2018
;; MSG SIZE rcvd: 55

Источник

Читайте также:  Cairo dock astra linux

Unable to ping gateway & other Linux boxes on same network

I’m somewhat new to Linux, but I’m trying to network a few Linux machines. I can’t seem to be able ping the gateway or the other Linux machines. My scenario: I have a few Linux boxes set up on a 10.45.89.x subnet with the gateway being 10.45.89.1 . On all of these, I’m unable to ping anything except 127.0.0.1 . I’m wondering if I need to modify any of the routing tables or hosts file. Below is a few commands and their output. Perhaps I need to check something else?

netstat -r output:

10.45.89.0 * 255.255.255.0 U 10.112.0.0 * 255.255.0.0 U 169.254.0.0 * 255.255.0.0 U default 10.45.89.1 0.0.0.0 UG 

/etc/hosts

127.0.0.1 localhost.localdomain localhost 127.0.0.1 localhost.localdomain localhost 9.37.253.154 rpt.rhn.linux.ul.com 

/etc/resolv.conf

domain demolotus.com namserver 127.0.0.1 

/etc/sysconfig/network

NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=st852.demolotus.com 

ip route show dev eth0

10.45.89.0/24 proto kernel scope link src 10.45.89.138 default via 10.45.89.1 

ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:01:28:CD inet addr:10.45.89.138 Bcast:10.45.89.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 eth0:0 Link encap:Ethernet HWaddr 00:0C:29:01:28:CD inet addr:10.45.89.139 Bcast:10.45.89.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 

ip addr show dev eth0

2: etho0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:0c:29:01:28:cd brd ff:ff:ff:ff:ff:ff inet 10.45.89.138/24 brd 10.45.89.255 scope global eth0 inet 10.45.89.139/24 brd 10.45.89.255 scope global secondary eth0:0 

Источник

Can’t ping default gateway on ubuntu 18.0

ifconfig

enp12s0: flags=4163 mtu 1500 inet 172.30.149.90 netmask 255.255.255.240 broadcast 172.30.149.95 ether f0:1f:af:3e:73:a3 txqueuelen 1000 (Ethernet) RX packets 2005 bytes 154598 (154.5 KB) RX errors 0 dropped 380 overruns 0 frame 0 TX packets 950 bytes 117982 (117.9 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1000 (Boucle locale) RX packets 31843 bytes 1932467 (1.9 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 31843 bytes 1932467 (1.9 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

route -n

Table de routage IP du noyau Destination Passerelle Genmask Indic Metric Ref Use Iface 0.0.0.0 172.30.149.94 0.0.0.0 UG 20100 0 0 enp12s0 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp12s0 172.30.149.80 0.0.0.0 255.255.255.240 U 100 0 0 enp12s0 

ping 172.30.149.94

PING 172.30.149.94 (172.30.149.94) 56(84) bytes of data. From 172.30.149.90 icmp_seq=1 Destination Host Unreachable From 172.30.149.90 icmp_seq=2 Destination Host Unreachable From 172.30.149.90 icmp_seq=3 Destination Host Unreachable ^C --- 172.30.149.94 ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4080ms 

cat /etc/NetworkManager/NetworkManager.conf

[main] plugins=ifupdown,keyfile [ifupdown] managed=false [device] wifi.scan-rand-mac-address=no 

dhclient -v enp12s0

Internet Systems Consortium DHCP Client 4.3.5 . Listening on LPF/enp12s0/f0:1f:af:3e:73:a3 Sending on LPF/enp12s0/f0:1f:af:3e:73:a3 Sending on Socket/fallback DHCPDISCOVER on enp12s0 to 255.255.255.255 port 67 interval 3 (xid=0x2d28ac1e) DHCPDISCOVER on enp12s0 to 255.255.255.255 port 67 interval 5 (xid=0x2d28ac1e) 

arp -na

? (172.30.149.92) à sur enp12s0 ? (172.30.149.94) à sur enp12s0 

ip neighbor show

172.30.149.92 dev enp12s0 FAILED 172.30.149.94 dev enp12s0 FAILED 

iptables -L -v -n

Chain INPUT (policy ACCEPT 6000 packets, 368K bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 6010 packets, 369K bytes) pkts bytes target prot opt in out source destination 

cat /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) .. # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers. nameserver 127.0.0.53 

ip addr

1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: enp12s0: mtu 1500 qdisc mq state UP group default qlen 1000 link/ether f0:1f:af:3e:73:a3 brd ff:ff:ff:ff:ff:ff inet 172.30.149.90/28 brd 172.30.149.95 scope global noprefixroute enp12s0 valid_lft forever preferred_lft forever 3: wlp2s0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 70:18:8b:70:10:4a brd ff:ff:ff:ff:ff:ff 

sysctl -p

net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 

iptables -t nat -L -v -n

Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source >destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 

telnet 172.30.149.94 22

Trying 172.30.149.94. telnet: Unable to connect to remote host: No route to host 

telnet 172.30.149.94 80

Trying 172.30.149.94. telnet: Unable to connect to remote host: No route to host 

cat /etc/network/interfaces

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

iptables -L

Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination 

tcpdump -v arp

tcpdump: listening on enp12s0, link-type EN10MB (Ethernet), capture size 262144 bytes 13:44:09.289931 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has _gateway tell teltest, length 28 13:44:10.314067 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has _gateway tell teltest, length 28 13:44:14.021038 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 62.201.153.150 tell 62.201.153.145, length 46 13:44:14.021065 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 62.201.153.142 tell 62.201.153.137, length 46 13:44:14.409927 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has _gateway tell teltest, length 28 13:44:15.433950 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has _gateway tell teltest, length 28 13:44:16.457979 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has _gateway tell teltest, length 28 13:44:17.481925 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has _gateway tell teltest, length 28 13:44:18.505913 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has _gateway tell teltest, length 28 13:44:19.021013 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 62.201.153.142 tell 62.201.153.137, length 46 

Источник

Оцените статью
Adblock
detector