instalação mínima CentOS6.6 configuração de rede (atualizada)

0

Eu atualizo minha pergunta.

Eu faço a mesma pergunta para o estouro de pilha, mas é melhor perguntar aqui.

Estou tendo problemas com a configuração da rede da minha estação de trabalho após a instalação mínima do sistema operacional. Eu editei vi /etc/sysconfig/network-scripts/ifcfg-em1 para estática. a partir da pesquisa do google, reinicio o serviço de rede novamente e novamente. mas ainda não pode se conectar à internet ou ping (exceto ping 127.0.0.1 ). Aqui estão minhas configurações.

[root@workstation ~]# uname -a
Linux workstation.XXXXX 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

[root@workstation ~]# ifconfig
em1       Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet addr:aaa.bbb.ccc.xxx  Bcast:aaa.bbb.211.255  Mask:255.255.252.0
          inet6 addr: XXXX::XXXX:XXX:XXXX:XXXX/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12465754 errors:0 dropped:0 overruns:0 frame:0
          TX packets:238 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1507354446 (1.4 GiB)  TX bytes:35268 (34.4 KiB)
          Interrupt:16

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:65536  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1316 (1.2 KiB)  TX bytes:1316 (1.2 KiB)

[root@workstation ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    inet aaa.bbb.ccc.xxx/22 brd aaa.bbb.211.255 scope global em1
    inet6 XXXX::XXXX:XXXX:XXXX:XXXX/64 scope link
       valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff

[root@workstation ~]# vi /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1
HWADDR=54:9F:35:1F:58:D0
TYPE=Ethernet
UUID=7337edf4-f9f0-4dab-9d3d-6f031e7180cc
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=aaa.bbb.ccc.132
NETMASK=255.255.252.0
NAME="System em1"
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
PREFIX=22
GATEWAY=aaa.bbb.156.5
DNS1=aaa.bbb.10.2
DOMAIN=168.126.63.1

[root@workstation ~]# service network restart
Shutting down interface em1:                               [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface em1:  Determining if ip address aaa.bbb.208.132 is already in use for device em1...
                                                           [  OK  ]
[root@workstation ~]# yum list
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base

[root@workstation ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=workstation.XXXXX
GATEWAY=aaa.bbb.156.5

Obrigado pela sua resposta sim, @larsks em1 é ip estático, não DHCP. Aqui é ip route

[root@workstation ~]# ip route
aaa.bbb.ccc.0/22 dev em1  proto kernel  scope link  src aaa.bbb.ccc.xxx
169.254.0.0/16 dev em1  scope link  metric 1002

Aqui está vi /etc/resolv.conf

[root@workstation ~]# vi /etc/resolv.conf
nameserver aaa.bbb.10.2
search 168.126.63.1

Altero NETWORK para GATEWAY , mas ainda não consigo me conectar à internet.

Além disso, muito obrigado por me ajudar. Eu acho que estamos perto de solução.

    
por Cho Intae 22.08.2016 / 03:28

1 resposta

0

Finalmente, resolvo o problema.

[root@workstation network-scripts]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
aaa.bbb.ccc.0   0.0.0.0         255.255.252.0   U     0      0        0 em1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 em1

Não existe 'Gateway padrão',

[root@workstation network-scripts]# ip route add 155.230.156.5 dev em1
[root@workstation network-scripts]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
aaa.bbb.156.5   0.0.0.0         255.255.255.255 UH    0      0        0 em1
aaa.bbb.ccc.0   0.0.0.0         255.255.252.0   U     0      0        0 em1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 em1

E, a seguir,

[root@workstation network-scripts]# route add default gw 155.230.156.5 dev em1
[root@workstation network-scripts]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
aaa.bbb.156.5   0.0.0.0         255.255.255.255 UH    0      0        0 em1
aaa.bbb.ccc.0   0.0.0.0         255.255.252.0   U     0      0        0 em1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 em1
0.0.0.0         aaa.bbb.156.5   0.0.0.0         UG    0      0        0 em1 ← "default GATEWAY"

Confirmando a conexão,

[root@workstation network-scripts]# ping www.google.co.kr
PING www.google.co.kr (216.58.199.99) 56(84) bytes of data.
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=1 ttl=50 time=82.8 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=2 ttl=50 time=47.2 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=3 ttl=50 time=46.9 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=4 ttl=50 time=47.0 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=5 ttl=50 time=57.3 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=6 ttl=50 time=47.0 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=7 ttl=50 time=47.6 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=8 ttl=50 time=47.6 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=9 ttl=50 time=46.9 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=10 ttl=50 time=47.0 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=11 ttl=50 time=47.5 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=12 ttl=50 time=47.0 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=13 ttl=50 time=47.5 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=14 ttl=50 time=57.8 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=15 ttl=50 time=47.5 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=16 ttl=50 time=47.4 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=17 ttl=50 time=53.0 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=18 ttl=50 time=47.6 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=19 ttl=50 time=47.5 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=20 ttl=50 time=47.5 ms
64 bytes from hkg07s22-in-f3.1e100.net (216.58.199.99): icmp_seq=21 ttl=50 time=47.0 ms
^C
--- www.google.co.kr ping statistics ---
21 packets transmitted, 21 received, 0% packet loss, time 20694ms
rtt min/avg/max/mdev = 46.961/50.269/82.824/7.940 ms

Mas, quando eu reboot ou service network restart , ele é restaurado. Agora eu me pergunto como salvá-lo permernant.

Eu entendi um pouco sobre o Linux Networking. Obrigado novamente por me ajudar.

    
por 22.08.2016 / 09:41