修正する

修正する

これは次の構成です/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
UUID=c7sdfsdf-dfgdgdfgdgd-dg
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=x.x.x.x
NETMASK=255.255.255.0
GATEWAY=x.x.x.y
DNS1=8.8.8.8
DNS2=4.2.2.4
ARPCHECK=no
HWADDR=00:0C:29:9D:D1:CC

そしてresolv.conf

nameserver 8.8.8.8
nameserver 4.2.2.4

google.comをpingしてwgetすることはできません。

From x.x.x.y icmp_seq=1 Destination Net Unreachable

そして

# curl http://google.com
curl: (6) Couldn't resolve host 'google.com'

修正する

# nslookup google.com
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached

# dig ns.google.com @8.8.8.8

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.1 <<>> ns.google.com @8.8.8.8
;; global options: +cmd
;; connection timed out; no servers could be reached

ベストアンサー1

すでにコメントで述べたように、アカウントを確認する必要があります。デフォルトパス。これは$ ip r次の方法で達成できます。次の内容が表示されます。

$ ip r
default via 10.0.0.1 dev eth1 
10.0.0.0/24 dev eth1  proto kernel  scope link  src 10.0.0.143 
169.254.0.0/16 dev eth1  scope link  metric 1001

メモ:基本値はアドレスとして表示することもできます0.0.0.0

システムにデフォルトパスがない場合は、次のようにします。

$ ip r add default via 10.0.0.1 dev eth1

当然、自分のルーター/ゲートウェイのIPアドレスを交換する必要があります。開発者パラメーター(eth1)を目的のインターフェース名で指定します。

おすすめ記事