Setting Up A Static IP Address
-
- Posts: 152
- Joined: Sun Aug 30, 2020 12:04 am
- Has thanked: 87 times
- Been thanked: 46 times
Re: Setting Up A Static IP Address
Re: Setting Up A Static IP Address
What it does:
- setup /etc/network/interfaces
- setup dns server
- disable (or enable) dhcp client daemon
- setup mac address
The scripts can be found in the attached zip file.
- Attachments
-
- network_ip_static.zip
- (2.43 KiB) Downloaded 337 times
Re: Setting Up A Static IP Address
yoshi41 wrote: ↑Sat Apr 23, 2022 10:29 amI use a couple of shell scripts to set static (and dhcp) ip and mac address. Just change the variables in the script for your network setup and run it on the linux shell. It sometimes works from the MiSTer menu, but most of the time /etc is not writeable.
What it does:
- setup /etc/network/interfaces
- setup dns server
- disable (or enable) dhcp client daemon
- setup mac address
The scripts can be found in the attached zip file.
Thanks but from what I see, it set-up the mac address for eth0.
my issue is on wlan0.
I did the change in u-boot.txt manualy and it did not work.
Re: Setting Up A Static IP Address
Each wifi adapter has it‘s own unique mac (hardware) address. There is no need to change it.
The mac address for eth0 is by default the same for every MiSTer. This is a problem if you have more than one MiSTer in your network. In this case, you can assign your own unique mac address.
-
- Top Contributor
- Posts: 1303
- Joined: Mon May 25, 2020 7:54 pm
- Has thanked: 416 times
- Been thanked: 399 times
Re: Setting Up A Static IP Address
I've been struggling with this for quite some time now. Nearly every time I try to log in to MiSTer via WinSCP it fails, because the IP (displayed in the OSD) is different.
I know nothing about networking, it's always been my Kryptonite, so would like to use yoshi41's script. I tried to do it from WinSCP but don't know what command to use - I only get these "not understood errors"
-
- Posts: 152
- Joined: Sun Aug 30, 2020 12:04 am
- Has thanked: 87 times
- Been thanked: 46 times
Re: Setting Up A Static IP Address
Not really familiar with WinSCP, but what if you try this?
Code: Select all
./network_ip_static_wlan0.sh
-
- Top Contributor
- Posts: 1303
- Joined: Mon May 25, 2020 7:54 pm
- Has thanked: 416 times
- Been thanked: 399 times
Re: Setting Up A Static IP Address
Ok, I managed to run the script from the Linux terminal on the mister itself (F9). But, I didn't change the default values in the script first, so now I can't log in via WinSCP at all.
I suppose I should try and modify the script directly on the SD card and then run it again. Question is, what values should I use? My PC is connected to the router via ethernet and MiSTer uses wifi dongle. The script (I use the wlan0 one) requires to: "set ip address, subnet mask, standard gateway and dns server". Are these the values found in Win Settings>>Network Connections >>Ethernet>>Status>>Details?
Re: Setting Up A Static IP Address
Yes, you can use the values from the ethernet status details page.
Or from this command in the Windows cmd window...
Code: Select all
ipconfig /all
Regarding the script variables...
Code: Select all
SIA_IP=192.168.1.41
SIA_SM=255.255.255.0
SIA_GW=192.168.1.1
SIA_NS=8.8.8.8
Make sure the IP address (SIA_IP) is not in the router DHCP address pool. For the DNS server (SIA_NS) you can use 8.8.8.8 (Google DNS server).
Also make sure the script remains in "Unix (LF)" format or edit the file with Linux vi (only if you know how to use it).
-
- Top Contributor
- Posts: 1303
- Joined: Mon May 25, 2020 7:54 pm
- Has thanked: 416 times
- Been thanked: 399 times
Re: Setting Up A Static IP Address
Thank you for the detailed reply, yoshi41. It did help me to sort it out (even though phrases such as "DHCP address pool" still make my mind go blank and using vi was a bit scary - after a few reboots the MiSTer's IP remains stable and WinSCP logs in instantly now every time.