VMWare의 RedHat 6.5 설치에 고정 IP 주소를 할당하기 위해 인터넷의 리소스를 따라갔습니다. 그 이후에는 인터넷에 접속할 수 없었습니다. 내가 변경한 파일의 터미널 출력은 다음과 같습니다.
[Piyush@redhatcdh4_1 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:BE:52:B7
TYPE=Ethernet
UUID=8bd6e426-9bad-4f0c-a098-9345e1d51bfa
ONBOOT=no
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.31.217
NETMASK=255.255.255.0
[Piyush@redhatcdh4_1 ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=redhatcdh4_1
GATEWAY=192.168.31.2
NTPSERVERARGS=iburst
ifconfig 명령의 출력은 다음과 같습니다.
[Piyush@redhatcdh4_1 ~]$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:BE:52:B7
inet addr:192.168.31.217 Bcast:192.168.31.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:febe:52b7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3611 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:226739 (221.4 KiB) TX bytes:636 (636.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:601 errors:0 dropped:0 overruns:0 frame:0
TX packets:601 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:46796 (45.6 KiB) TX bytes:46796 (45.6 KiB)
.
[Piyush@redhatcdh4_1 ~]$ route -n; ping -c3 192.168.31.2; ping -c3 4.2.2.2; cat /etc/resolv.conf
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.31.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
PING 192.168.31.2 (192.168.31.2) 56(84) bytes of data.
From 192.168.31.217 icmp_seq=1 Destination Host Unreachable
From 192.168.31.217 icmp_seq=2 Destination Host Unreachable
From 192.168.31.217 icmp_seq=3 Destination Host Unreachable
--- 192.168.31.2 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3003ms
pipe 3
connect: Network is unreachable
# Generated by NetworkManager
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
내가 뭔가를 엉망으로 만들었나요? 오류를 지적하기 위해 더 많은 데이터가 필요하면 언제든지 문의하세요.