Setting static IP
-
Do you guys know how can I set a static IP address for the wifi (wlan0 - the one that connects to my router)?
-
-
I'd configure the router to assign the same ip to the omega always. No need to change anything in the omega then
-
If you really want to do it in the omega, you can configure a static ip instead of using dhcp. Have a look in
/etc/config/network
and/etc/config/wireless
. You probably have to change thewwan
entry in/etc/config/network
to useoption proto 'static'
instead ofoption proto 'dhcp'
— see the examples in/etc/config/network
(just a guess, I didn't check this).
-
-
@Ferhat-Ural You can also setup a DHCP reserved list on your router. This will link a specific IP to the MAC address of the Omega, so whenever this Omega connects it will always have the same IP address assigned by your router.
-
Thanks will try both
-
Edited the /network file and I was able to login to the network with the desired IP address. But I don't know how to setup nameservers since without them I cannot ping domain names (but I can ping the router).
Here is my setup (I tried option dns-nameservers but with out luck) :
config interface 'wwan'
option proto 'static'
option hostname 'OnionOmega'
option ipaddr '10.0.0.70'
option netmask '255.255.255.0'
option gateway '10.0.0.2'
option dns-nameservers '8.8.8.8'
-
I can permanently edit resolv.conf but it is cleared on the next boot
-
In your network configure file set
option dns '8.8.8.8'Restart networking
/etc/init.d/network restartShould work
-
thank you @mark-doutre everything works now
-
Edit the file /etc/config/network, change wan section as below,
config interface 'wan'
option ifname 'eth0'
option proto 'static'
option ipaddr '192.168.1.38'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
option dns '192.168.1.1'Restart network by
/etc/init.d/network restart