메뉴 건너뛰기

리눅스 관련 모음

본문시작

에러해결
2014.10.27 20:00

CentOS-7 Network 설정에 관하여....

조회 수 7707 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

국산 통나무 수공예 남원제기, 남원목기

자료가 도움이 되셨다면
혼수용품제수용품 필요시
남원제기 공식 홈페이지 http://남원제기.kr
남원목기 공식 홈페이지 http://otchil.kr
에서 구매 해 주세요
정성껏 모시겠습니다.
 

Questions about CentOS-7

1. I used to use the boot.iso image to do network installations. Where has it gone?

Starting with EL6, upstream decided to remove boot.iso from the images/ directory and ship it as a separate, stand alone media. Due to the large size of this image, we have decided to do the same. The network installation disk image is named netinstall.iso and can now be found only in the isos/ directory, together with all other installation images.

2. Why does my Ethernet not work unless I log in and explicitly enable it?

.. and why are the interface names all "messed up" compared to prior practice? This violates the Unix rule of "not breaking expectations".

Upstream has changed the default configuration to use NetworkManager and interfaces are (somewhat inexplicably in the case of Ethernet) not enabled by default. This can be worked around at install time where you have the possibility to enable your network card at the main installer screen, where the installer asks for your language/keyboard/storage devices/software installation. On this screen is a button labeled "Network & Hostname". Click that button, select the Ethernet connection you want to edit and click the "Off"-Button on the top right corner. Assuming DHCP is available you will see the connection in question getting a network address. If you have to configure your network settings by hand, press the "Configure" button, enter the desired values and save them. You probably have to disable and re-enable the just configured NIC for the changes to take affect. Now press "Done" and that's it. You can also make these changes with NetworkManager (System; Preferences; Network Connections or right click on the little network icon in the notification area and Edit Connections...) after the installation is complete.

If you are not using NetworkManager, the same result can be obtained by editing the configuration file for the network interface ( normally /etc/sysconfig/network-scripts/ifcfg-eth0 ) and changing: ONBOOT=no to ONBOOT=yes Some setups seem to also require the addition of a line: BOOTPROTO=dhcp where a DHCP setup is in play; Static IP setups would take: BOOTPROTO=static of course

The ONBOOT edit may be performed (as root) and assuming the relevant device is eth0:

# cd /etc/sysconfig/network-scripts/ 
# sed -i -e 's@^ONBOOT="no@ONBOOT="yes@' ifcfg-eth0

As to "breaking expectations": The foregoing example uses a 'traditionally' named network device of: eth0 Other device names are also possible, including for example: em1 or p3p1 and such. Like it or not, this change in approach in interface naming is the future path for Linux. It was previewed in in the upstream's "testing distribution". See also the materials at: Dell's writeup and a blog post from an insider there.

3. And what if I want the old naming back?

These are the necessary steps:

  • Add "net.ifnames=0" and "biosdevname=0" as kernel arguments to grub
  • In '/etc/sysconfig/network-scripts/' Change your configured NIC config file to 'ifcfg-ethX'
  • If you have multiple interfaces and want to control naming of each device rather than letting the kernel do in its own way, /etc/udev/rules.d/60-net.rules seems necessary to override /usr/lib/udev/rules.d/60-net.rules.

4. But I just want it to work and to hand-edit the configuration files.

Many installations do not require the complexity of the NetworkManager tool, and use hand-edited configuration files instead. Here is a sample non NetworkManager DHCP interface configuration:

[root@example ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO=dhcp
NM_CONTROLLED="no"
PERSISTENT_DHCLIENT=1
ONBOOT="yes"
TYPE=Ethernet
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME="eth0"
[root@none ~]#

and a sample 'static assignment' configuration file:

[username@hostname]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="00:21:70:10:7E:CD"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=static
# BOOTPROTO=dhcp
IPADDR=10.16.1.106
NETMASK=255.255.255.0
#
#   the GATEWAY is sometimes in: /etc/sysconfig/network
GATEWAY=10.16.1.1

and then common items such as hostname and DNS servers may optionally be placed in:

[username@hostname]$ cat /etc/sysconfig/network
HOSTNAME=acme.example.com
DNS1=10.16.1.112
DNS2=8.8.8.8
## DNS2=76.242.0.28
SEARCH=example.com

The information there is 'optional' because a DHCP server can hand out these values. The initscripts are able to figure out hostname and so forth when a well-populated DNS environment exists, from PTR records and such, but some users need to manage such details manually. For more information, the full initscripts documentation files may be listed thus:

rpm -qd initscripts 

even in a environment lacking the man manual reading package and its dependencies.

5. How do I disable IPv6?

Upstream employee Daniel Walsh recommends not disabling the ipv6 module, as that can cause issues with SELinux and other components, but adding the following to /etc/sysctl.conf:

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

To disable in the running system:

echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

or

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1

Additional note #1: If problems with X forwarding are encountered on systems with IPv6 disabled, edit /etc/ssh/sshd_config and make either of the following changes:

(1) Change the line

#AddressFamily any

to

AddressFamily inet

(inet is ipv4 only; inet6 is ipv6 only)

or

(2) Remove the hash mark (#) in front of the line

#ListenAddress 0.0.0.0

Then restart ssh.

Additional note #2: If problems with starting postfix are encountered on systems with IPv6 disabled, either

(1) edit /etc/postfix/main.cf and comment out the localhost part of the config and use ipv4 loopback.

#inet_interfaces = localhost
inet_interfaces = 127.0.0.1

or

(2) take out the ipv6 localhost from /etc/hosts .

Additional Note #3 : To disable RPCBIND ipv6 (rpcbind, rpc.mountd, prc.statd) remark out the udp6 and tcp6 lines in /etc/netconfig:

udp        tpi_clts      v     inet     udp     -       -
tcp        tpi_cots_ord  v     inet     tcp     -       -
#udp6       tpi_clts      v     inet6    udp     -       -
#tcp6       tpi_cots_ord  v     inet6    tcp     -       -
rawip      tpi_raw       -     inet      -      -       -
local      tpi_cots_ord  -     loopback  -      -       -
unix       tpi_cots_ord  -     loopback  -      -       -
   

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
170 실제 예(passwd명령어)로 SetUID, SetGID 이해하기 햇빛소년 2011.05.12 50477
169 한국에 맞는 스팸어쎄신 설정하여 스팸 95% 줄여보기 햇빛소년 2011.03.18 50196
168 Solving the "Can't connect to UNIX socket" and "/parts: Access denied" problems. 햇빛소년 2011.04.08 49950
167 파이프, 필터, 리다이렉션 햇빛소년 2011.04.16 48491
166 spamassassin /320.pre -> Rule2XSBBody 체크시 에러 해결법 햇빛소년 2011.04.13 48101
165 리눅스 시스템정보 알아내기 file 햇빛소년 2011.05.12 47998
164 cpanm 햇빛소년 2011.04.04 47599
163 Linux Disable Core Dumps file 햇빛소년 2011.05.02 46486
162 ssh로 특정 ip접근 hosts.deny 자동 추가 햇빛소년 2011.05.12 45287
161 crontab 설정 햇빛소년 2011.05.12 45045
160 요긴하게 사용되는 리눅스 명령 모음. 햇빛소년 2011.04.07 44156
159 서버설치후 해야할 일 file 햇빛소년 2011.05.12 44096
158 DCC관련 명령어 모음 햇빛소년 2012.06.02 43924
157 sendmail + dovecot 설정 file 햇빛소년 2011.05.11 42405
156 설치관련 HTML태그+++JavaScript +객체 +정리 [펌] file 햇빛소년 2014.04.14 42398
155 chattr, lsattr 햇빛소년 2011.10.05 41615
154 내년부터 시험없이 국가기술자격 딴다 햇빛소년 2011.05.19 40541
153 참고로 보기 위한 좋은 글 -- q메일 및 스팸서버 구축에 관한 글 [펌] 햇빛소년 2012.06.19 39507
152 유동아이피를 고정아이피로 만들기 햇빛소년 2011.06.20 38319
151 segmentation fault가 발생할 때 디버깅 방법 햇빛소년 2012.01.05 38160
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 Next
/ 10