Gentoo 리눅스에서 네트워크 설정 하는 방법입니다.

– 유동 아이피 (DHCP)

ruo91 ~ # nano /etc/conf.d/net

# 인터페이스가 하나일 경우
config_eth0=”dhcp”
dhcpd_eth0=””
# 인터페이스가 여러개일 경우
config_eth1=”dhcp”
dhcpd_eth1=””
# eth2
config_eth2=”dhcp”
dhcpd_eth2=””
# eth3
config_eth3=”dhcp”
dhcpd_eth3=””

– 고정 아이피 (Static)

ruo91 ~ # nano /etc/conf.d/net

# eth0 인터페이스에 DNS 서버를 지정합니다.
dns_servers_eth0=”8.8.8.8 8.8.4.4″
# eth0 인터페이스에 기본게이트웨이를 설정 합니다.
routes_eth0=”default via 192.168.0.1″
# eth0 인터페이스에 고정 아이피와 넷마스크를 설정 합니다.
config_eth0=”192.168.0.2 netmask 255.255.255.0″

– 인터페이스에 네트워크 정보 받기

ruo91 ~ # /etc/init.d/net.eth0 restart

 * Starting eth0
 *   Bringing up eth0
 *     dhcp
 *       Running dhcpcd …
eth0: dhcpcd 4.0.15 starting
eth0: broadcasting for a lease
eth0: offered 192.168.0.2 from 192.168.0.1
eth0: acknowledged 192.168.0.2 from 192.168.0.1
eth0: checking 192.168.0.2 is available on attached networks
eth0:
leased 192.168.0.2 for 3600
seconds                                                                                                            
[ ok ]
 *       eth0 received address 192.168.0.2/24

– 여러개의 인터페이스가 존재 하는 경우
루프백 인터페이스의 /etc/init.d/net.lo 파일을 심볼릭 링크를 통해 인터페이스 별로 생성합니다.

ruo91 ~ # cd /etc/init.d
ruo91 ~ # ln -s net.lo net.eth1

부팅시 자동으로 실행 되도록 등록 합니다.

ruo91 ~ # rc-update add net.eth1 default

참고
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2