Recent Posts
Recent Comments
05-17 18:00
관리 메뉴

Mandoo’s WLAN story

[Linux/OpenWrt] Openwrt Network 설정 본문

Linux

[Linux/OpenWrt] Openwrt Network 설정

mandoo12 2021. 11. 11. 17:06

OpenWrt에서 고정 IP를 설정 해주는 방법을 알아보자

ifconfig 명령어를 이용해 설정도 가능하지만 재부팅하면 원복되기 때문에 config 파일이 수정되도록 uci 명령어를 이용해 설정해주어야한다.

config 파일 위치 : /etc/config/network

wan은 무선인터페이스 이름을 넣어주자

# 고정 IP로 설정
uci set network.wan.proto='static'

#ip
uci set network.wan.ipaddr='A.B.C.D'

#게이트웨이
uci set network.wan.gateway='A.B.C.D'

# 서브넷 마스크
uci set network.wan.netmask='A.B.C.D'

# DNS 설정
uci set network.wan.dns='A.B.C.D'
secondary ip까지 설정할 경우
uci set network.wan.dns='A.B.C.D A.B.C.D'

# 저장
uci commit
저장까지 해주어야 config 파일이 직접적으로 수정된다.
하지만 수정된 config 파일을 바로 불러오지 못하는 경우가 있기 때문에 네트워크 서버를 재시작해준다.

# 네트워크 서버 재시작
/etc/init.d/network restart