Configuring Static IP addresses for the DreamPi and Dreamcast

Technical help for Dreamcast console, accessories and games only. Ask questions and find answers here. For Online help see the Online Forum
User avatar
thecodygriffin
undertow
Posts: 31
Dreamcast Games you play Online: 4x4 Evolution, Sega Swirl, Quake III Arena, World Series Baseball 2K2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by thecodygriffin »

Wow! Talk about a blast from the past. I really need to boot up my Dreamcast and Dreampi again.

@TigerMacZ I haven't thought of this since I wrote the guide, but if I recall correctly, that command doesn't have to be entered when in a certain directory. It should apply system-wide. I have two suggestions:

1. Try

Code: Select all

sudo update-rc.d -f dhcpcd remove
instead. It is very possible that my initial post has a typo. After some quick Googling, it appears that there should NOT be a space between "update" and "-rc.d".

2. If that does not work, you can also stop stop dhcpcd with

Code: Select all

sudo systemctl stop dhcpcd.service
and then disable it so that it doesn't restart on after reboot with

Code: Select all

sudo systemctl disable dhcpcd.service
. If for whatever reason, you need to restart or re-enable it, replace "stop" and "disable" with "start" and "enable" respectively.

Good luck!

User avatar
TigerMacZ
undertow
Posts: 25
Dreamcast Games you play Online: A variety, PSO ver 2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by TigerMacZ »

thanks man for the quick reply, its been stressing me out as i mvoed ohuse and had to get a new isp but thier internet hub thnig really does not like the pi switching ip addresses and keeps assigning the dreamcast ip when it boots up even excluding it from the ip range didnt help

User avatar
TigerMacZ
undertow
Posts: 25
Dreamcast Games you play Online: A variety, PSO ver 2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by TigerMacZ »

i had a bit of a mishap being that i somehow managed to know the wifi of the pi off but it seems to be working atm, i;ll give it a run through

User avatar
TigerMacZ
undertow
Posts: 25
Dreamcast Games you play Online: A variety, PSO ver 2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by TigerMacZ »

thecodygriffin wrote:Wow! Talk about a blast from the past. I really need to boot up my Dreamcast and Dreampi again.

@TigerMacZ I haven't thought of this since I wrote the guide, but if I recall correctly, that command doesn't have to be entered when in a certain directory. It should apply system-wide. I have two suggestions:

1. Try

Code: Select all

sudo update-rc.d -f dhcpcd remove
instead. It is very possible that my initial post has a typo. After some quick Googling, it appears that there should NOT be a space between "update" and "-rc.d".

2. If that does not work, you can also stop stop dhcpcd with

Code: Select all

sudo systemctl stop dhcpcd.service
and then disable it so that it doesn't restart on after reboot with

Code: Select all

sudo systemctl disable dhcpcd.service
. If for whatever reason, you need to restart or re-enable it, replace "stop" and "disable" with "start" and "enable" respectively.

Good luck!

quick question is there anything i need to do different as instead of a ethernet connection its a wireless one, but also the ip address of the pi is .183 comapred to the .98 of the dreamcast but it seems like when i get some some of the settings it just knocks hte pi offline and then i still have issues with the hub forcing the ip of the dreamcast onto the pi

User avatar
thecodygriffin
undertow
Posts: 31
Dreamcast Games you play Online: 4x4 Evolution, Sega Swirl, Quake III Arena, World Series Baseball 2K2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by thecodygriffin »

I know some Linux packages and configurations do treat ethernet interfaces differently than wireless interfaces, but I am not sure that Raspbian (the Raspberry Pi Linux distribution used as the base for Dreampi does). It has been a longtime since I looked at the dreampi script in /usr/bin/local. I'd start there and read through the comments in it.

With that said, I am fairly confident that the interface name will NOT be "eth0" for the wireless interface. You can list your interfaces with "ip a". I'd bet that you have at least 3: "lo" for the loopback interface, "eth0" or "enp#s#" for the ethernet interface, and then a third for the wireless interface. I honestly can't remember if the ppp0 interface is in the configuration or is generated at runtime on Dreamcast connection to Dreampi. If it is in the configuration, that would make a 4th.

Regarding your IP addresses of .183 and .98, that is strange and I am not sure how it would occur given that the dreampi script should be starting at IP address .100 and working its way down towards .0. If you have a combination other .99 and .98 for the Dreampi and the Dreamcast respectively, it would be lower than .100, not higher from what I recall.

In these sort of circumstances, I typically just start over with a clean slate and work though the previous steps again to identify possible mistakes I've made or how much situation may deviate from the guide I am following.

User avatar
TigerMacZ
undertow
Posts: 25
Dreamcast Games you play Online: A variety, PSO ver 2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by TigerMacZ »

well like i said all this tech and programming stuff isnt my strong point so, i wouldnt know where i;d start

User avatar
thecodygriffin
undertow
Posts: 31
Dreamcast Games you play Online: 4x4 Evolution, Sega Swirl, Quake III Arena, World Series Baseball 2K2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by thecodygriffin »

@TigerMacZ Now that I've finished another project and I saw that DreamPi 1.8 DLE was released last month, I am looping back around to this and I realize that my original post is outdated (and to be honest, not as helpful as I originally intended).

When I wrote it, I had way less experience with Linux than I do now. Although what I did worked (at least for me), I couldn't articulate all of the inner workings and exactly why it worked. With what I know now, I can admit I got lucky with it working in the first place.

After taking a quick look at the out of the box configurations for the DreamPi 1.8 DLE image along with the dreampi scripts and services, I believe the changes required to set a known static IP address for both the dreampi primary network interface and the dreamcast network interface should be straight-forward. More importantly, I can articulate why each change is made to help those whose setups differ slightly.

I am going to run through it this week, ensure that my assumptions are directionally correct, and post an updated guide on Saturday at the latest that includes suggestions for those who have a wireless network interface.

User avatar
thecodygriffin
undertow
Posts: 31
Dreamcast Games you play Online: 4x4 Evolution, Sega Swirl, Quake III Arena, World Series Baseball 2K2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by thecodygriffin »

This following is an updated guide based on the DreamPi 1.8 DLE image. Although the risk of making such changes should be minimal, your setup may differ and therefore the results may as well.

There are a minimum of three IP addresses when using a DreamPi:
  1. The IP address of the DreamPi primary network interface
  2. The IP address of the DreamPi for the point-to-point network interface with the Dreamcast
  3. The IP address of the Dreamcast for the point-to-point network interface with the DreamPi
If all you are concerned with is ensuring that the Dreamcast has a static IP address so that you can forward ports to it or put your Dreamcast in the DMZ of your router, then all you will need to complete this this first section.

Section 1
Update the dreampi auto configuration script
When you connect to a Dreamcast game online, the dreampi script creates the point-to-point connection between the DreamPi and the Dreamcast. The resulting network interface, ppp0, consists of two IP addresses.

The default behavior of the DreamPi script is to identify two IP addresses that are available on your local network. It starts at .100 and counts down in increments of 1. In the vast majority of cases, this will result in an IP address ending in .99 for the DreamPi and .98 for the Dreamcast in the point-to-point, ppp0, network interface.

If you want to set these statically, the changes that need to be made are pretty simple.

Open the dreampi script in a text editor:

Code: Select all

sudo nano /usr/local/bin/dreampi
Find the lines of code that read:

Code: Select all

    this_ip = find_next_unused_ip(".".join(subnet) + ".100")
    dreamcast_ip = find_next_unused_ip(this_ip)
Change the lines to read:

Code: Select all

    this_ip = "10.16.8.19"
    dreamcast_ip = "10.16.8.20"
You will want to ensure that you are using your local network details for both addresses. The IP addresses can really be whatever you want as long as they are valid for your network and do not conflict with each other or any other devices.

If you are anal-retentive like I am and you don't want the now unused functions for ip_exists and find_next_unused_ip sitting there in the code without a purpose, you can either comment it out or remove it entirely. If you do not know what this means, don't worry about it.

Once done editing the /usr/local/bin/dreampi file, press Ctrl + X at the same time, type "y" or "yes" at the prompt to save modified buffer, and press Enter to write and close.

Reboot your Raspberry Pi by entering:

Code: Select all

sudo shutdown -r now
To verify that your changes have taken effect, simply connect to a Dreamcast game online and run the following command:

Code: Select all

ip a
The result should include at least 3 network interfaces including the point-to-point, ppp0, network interface.

Code: Select all

3: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
    link/ppp 
    inet 10.16.8.19 peer 10.16.8.20/32 scope global ppp0
       valid_lft forever preferred_lft forever
As you can see, per my setup, my DreamPi has an IP address of 10.16.8.19 and my Dreamcast has an IP address of 10.16.8.20.

I can now forward my ports to 10.16.8.20 or set my DMZ to that value on my router.

Section 2 optional
If you want the DreamPi primary network interface to have a static IP address as well, you can configure that through the networking service. My reasoning for doing this is so that I can manage the DreamPi headlessly (i.e. without a monitor connected) over SSH. It is a lot easier to know the IP address than to have to look up the IP address on my router each time I want to connect.

Note: I have a Raspberry Pi B+ with ethernet only. If you use a Raspberry Pi with a wireless network as your primary network interface, the steps you will need to follow may differ.

Disable dhcpcd
When installed on a Linux installation, dhcpcd is responsible for configuring a computer's network interface(s) to work on any attached network(s). It retrieves the gateway, IP address, and DNS information from your DHCP server, likely your router, and configures automatically configures your computer accordingly.

For me, with the DreamPi 1.8 DLE image defaults, dhcpcd fails to start upon boot. Therefore, disabling it here will likely not matter, but I am going to disable it anyways because I won't need it after setting a static IP address.

To disable the dhcpcd systemd service, enter:

Code: Select all

sudo systemctl disable dhcpcd
To validate that the command worked and the dhcpcd systemd service is disabled, enter:

Code: Select all

systemctl status dhcpcd
If successful, something along the lines of the following will be displayed:

Code: Select all

Warning: dhcpcd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/lib/systemd/system/dhcpcd.service; disabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/dhcpcd.service.d
           └─wait.conf
   Active: inactive (dead)
Update the /etc/network/interfaces configuration
It appears the DreamPi 1.8 DLE image is using the standard Debian network manager to configure the network interface(s). This is great because it is a very simple and straight-forward way to manage a network interface from the command line.

Open the interfaces file in a text editor:

Code: Select all

sudo nano /etc/network/interfaces
Upon opening it, it should read along the lines of:

Code: Select all

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
dns-nameserver 127.0.0.1

manual eth0
allow-hotplug eth0
iface eth0 inet dhcp
dns-nameserver 127.0.0.1
The first section of "wlan0" is for a wireless network interface and the second section of "eth0" is for a wired network interface.

To configure a static IP address for the wired network interface of "eth0", comment out everything in the file by adding a leading "#" to each line and then add the following:

Code: Select all

auto eth0
iface eth0 inet static
  address 10.16.8.18
  netmask 255.255.255.0
  gateway 10.16.8.1
Again, you will want to ensure that you are using your local network details for address, netmask, and gateway.

Once done editing the /etc/network/interfaces file, press Ctrl + X at the same time, type "y" or "yes" at the prompt to save modified buffer, and press Enter to write and close.

Reboot your Raspberry Pi by entering:

Code: Select all

sudo shutdown -r now
To verify that your changes have taken effect, run the following command:

Code: Select all

ip a
The result should include at least 2 network interfaces including the eth0 primary network interface.

Code: Select all

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:3b:3e:45 brd ff:ff:ff:ff:ff:ff
    inet 10.16.8.18/24 brd 10.16.8.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe3b:3e45/64 scope link 
       valid_lft forever preferred_lft forever
That's it. Now you should always be able to connect to your DreamPi via SSH at the same IP address.

User avatar
Scrivani
Metallic
Posts: 828
Dreamcast Games you play Online: Almost all

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by Scrivani »

Hey, just to me understand

You can hardcode any ip you want, from the same subnet.

Why all this?


I can have multiple raspberry , just change this_ip and dreamcast_ip to something like , 192.168.1.200 / 192.168.1.201, example.

And dmz or port forward the dreamcast_ip, if is the case.

But why modify anything else?
Happy if may help:
- https://bit.ly/scrivanidc
- BBA Mode for DreamPi: https://bit.ly/3JEIuhs
- VPN Port Fowarding: https://bit.ly/3Bgw4bu
- DC Now Data Analysis: https://bit.ly/42coxXw
- DC KARA NOT DEAD AT ALL- VCD Method: https://bit.ly/3P6VePw
- Know part of BR Community: https://bit.ly/3iLXS12

User avatar
thecodygriffin
undertow
Posts: 31
Dreamcast Games you play Online: 4x4 Evolution, Sega Swirl, Quake III Arena, World Series Baseball 2K2

Re: Configuring Static IP addresses for the DreamPi and Dreamcast

Post by thecodygriffin »

Unless I made a mistake, correct. You can hardcode any IP address you want in the /usr/local/bin/dreampi script. Nothing else is required. I only included the eth0 section as optional in case you want to connect to the DreamPi remotely via SSH.

  • Similar Topics
    Replies
    Views
    Last post
  • [GUIDE] Configuring VPN for Dreamcast approaches
    by Scrivani » » in Online
    24 Replies
    17101 Views
    Last post by Scrivani
  • Problem using static IP address
    by Orange Heart » » in Online
    11 Replies
    7410 Views
    Last post by pcwzrd13
  • Static on white/light colours on screen
    by BanuLam123. » » in Support
    1 Replies
    2814 Views
    Last post by Esppiral
  • Issues configuring DCnow
    by ClackAttack » » in Online
    1 Replies
    4068 Views
    Last post by pcwzrd13
  • Broadband adapter trouble configuring
    by SegaSen » » in Support
    9 Replies
    5543 Views
    Last post by SegaSen