User Tools

Site Tools


blog:2024:0517_amprd_on_fedora_40

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
blog:2024:0517_amprd_on_fedora_40 [2024/05/18 10:38] – [ampr.org requests] davekblog:2024:0517_amprd_on_fedora_40 [2026/11/23 12:22] (current) – davek
Line 1: Line 1:
 ====== 44net: amprd IPIP on Fedora 40 ====== ====== 44net: amprd IPIP on Fedora 40 ======
 +
 +(EDIT: correct recommended subnet mask for 44. Of course it's no longer /8. It should be within either 44.0.0.0/9 or 44.128.0.0/10.)
  
 The [[https://git.ampr.org/yo2loj/amprd|amprd]] package installs directly from the fedora repository. The configuration is straightforward, however getting firewalld and NetworkManager configured is a little tricky. The [[https://git.ampr.org/yo2loj/amprd|amprd]] package installs directly from the fedora repository. The configuration is straightforward, however getting firewalld and NetworkManager configured is a little tricky.
  
 The amprd documentation refers to requiring the ipip_redirector for 4.13+ kernels. It's not required for the 6.8.9 kernel that comes with Fedora 40. The amprd documentation refers to requiring the ipip_redirector for 4.13+ kernels. It's not required for the 6.8.9 kernel that comes with Fedora 40.
 +
 +Note for the most part the commands require root so put sudo in front of the commands or become root with 'sudo -i'
 +
 ====== ====== ====== ======
 +
  
 ===== ampr.org requests ===== ===== ampr.org requests =====
  
-For starters, you'll need an ampr IP address and gateway. Visit the [[http://portal.ampr.org|ampr portal]] and request an address. After you get an address, configure a gateway. Looking ahead, the first clue that you have the gateway correct is that you'll receive ripv2 packets when amprd is running. After pulling my hair out, I wasn't even sure my gateway was correct but upon misconfiguring it, the ripv2 packets stopped; so that was a good clue at least my gateway configuration was correct.+For starters, you'll need an ampr IP address, resource record (DNS), and gateway. Visit the [[http://portal.ampr.org|ampr portal]] and request an address. After you get an address, configure a RR and gateway. Looking ahead, the first clue that you have the gateway correct is that you'll receive ripv2 packets when amprd is running. After pulling my hair out, I wasn't even sure my gateway was correct but upon misconfiguring it, the ripv2 packets stopped; so that was a good clue at least my gateway configuration was correct.
  
-Note that changes in the portal can take a little while to take effect. For a gateway, I think an hour may be sufficient. But maybe it takes longer - since I was addressing several issues in the beginning, I'm not sure if maybe it took a day to take effect.+Note that changes in the portal can take a little while to take effect. For a gateway and resource record (DNS), I think an hour may be sufficient. But maybe it takes longer - since I was addressing several issues in the beginning, I'm not sure if maybe it took a day to take effect.
  
 Your gateway configuration uses the IP address and hostname of the external IP address from which your Fedora machine is visible to ampr.org. The IP address does not need to reverse resolve. If you don't have a spare hostname, configure an ampr.org DNS entry to resolve to your external IP address. If the hostname and IP don't match, the gateway IP entry updates to whatever the hostname resolves to - that's how you'll know you don't have your hostname resolving correctly. Your gateway configuration uses the IP address and hostname of the external IP address from which your Fedora machine is visible to ampr.org. The IP address does not need to reverse resolve. If you don't have a spare hostname, configure an ampr.org DNS entry to resolve to your external IP address. If the hostname and IP don't match, the gateway IP entry updates to whatever the hostname resolves to - that's how you'll know you don't have your hostname resolving correctly.
Line 40: Line 46:
 </code> </code>
  
-Note that this expects a firewalld zone named ampr to exist. We'll create that below. Be sure to fill in your IP address. We use CIDR /32 because amprd is going to create the correct route for you. So basically we don't want any routes yet, just an IP address on the interface.+The main issue I ran into was that the firewall zone was set to the firewalld default unless I created the interface to be managed by NetworkManager. 
 + 
 +Note that the configuration above expects a firewalld zone named ampr to exist. We'll create that below. Be sure to fill in your IP address. We use CIDR /32 because amprd is going to create the correct route for you. So basically we don't want any routes yet, just an IP address on the interface.
  
 Be sure to set the file permissions correctly (compare to others in the folder). Then restart NetworkManager. Be sure to set the file permissions correctly (compare to others in the folder). Then restart NetworkManager.
Line 76: Line 84:
 where the ingress-zone should match the zone of your internal network. Ensure the file permissions are correct for these files. where the ingress-zone should match the zone of your internal network. Ensure the file permissions are correct for these files.
  
-Finally reload firewalld: <code>sudo firewall-cmd --reload</code>+Finally reload firewalld: <code>firewall-cmd --reload</code>
  
 ===== amprd ===== ===== amprd =====
 Install amprd with: Install amprd with:
-<code>sudo dnf install amprd</code>+<code>dnf install amprd</code>
  
-Edit <code>/etc/amprd.conf</code> +Edit the file: <code>/etc/amprd.conf</code> 
-Define an ampr0 section. Enter your new 44 IP address into prefix with /8. That will enable all 44 traffic to be routed out the tunnel. If you want just a smaller subnet, use a narrower CIDR.+Define an ampr0 section. Enter your new 44 IP address into prefix with /9 or /10 depending on your allocation. That will enable respective 44 traffic to be routed out the tunnel. If you want just a smaller subnet, use a narrower CIDR.
  
 For now turn on multicast and rip. This will enable you to confirm you are connected to your gateway and receiving traffic. You can turn off the setting later if you like. For now turn on multicast and rip. This will enable you to confirm you are connected to your gateway and receiving traffic. You can turn off the setting later if you like.
  
 You don't need to set the rip_password. It hasn't changed in a long time and is compiled into the code. If you are interested in the password, I didn't find it with the -d option as the comment suggests (maybe I was running into other issues at the time) but I did see it using tcpdump. You don't need to set the rip_password. It hasn't changed in a long time and is compiled into the code. If you are interested in the password, I didn't find it with the -d option as the comment suggests (maybe I was running into other issues at the time) but I did see it using tcpdump.
 +
 +Amprd wants to save routes in /var/lib/amprd. Although it is running as root it can't create a file - probably selinux. Just touch the file and then it will work. If your interface is ampr0 then: <code>touch /var/lib/amprd/ampr0.txt</code>
 +
 +The next issue isn't critical but its a little annoying. The systemd service file for amprd says to use amprd's pidfile. By default amprd doesn't create a pidfile. You can either modify the amprd line to create a pidfile or you can remove systemd's directive to look for a pidfile. Systemd can figure out amprd's pid with the file so I chose the latter.
 +
 +In general don't modify /usr/lib/systemd/system/amprd.service. Instead copy it to /etc and edit the file as desired:
 +<code>
 +cp /usr/lib/systemd/system/amprd.service /etc/systemd/system/
 +# now edit the file, then...
 +systemctl daemon-reload
 +</code>
  
 Start up the amprd service and if you feel ready, enable it also to start on boot. To start it: Start up the amprd service and if you feel ready, enable it also to start on boot. To start it:
-<code>sudo systemctl start amprd</code>+<code>systemctl start amprd</code>
  
 ===== Try it out ===== ===== Try it out =====
 A couple of tcpdumps will let you look at what's going on. On your external interface you can monitor the traffic going to the internet and the encapsulated IPIP traffic: A couple of tcpdumps will let you look at what's going on. On your external interface you can monitor the traffic going to the internet and the encapsulated IPIP traffic:
-<code>sudo tcpdump -nnvi eno2 host 169.228.34.84</code>+<code>tcpdump -nnvi eno2 host 169.228.34.84</code>
  
 169.228.34.84 is the amprnet gateway. The host directive will only show you traffic going to amprnet and not flood your console will all your other internet traffic. 169.228.34.84 is the amprnet gateway. The host directive will only show you traffic going to amprnet and not flood your console will all your other internet traffic.
Line 115: Line 134:
 # examine the log and use ^C when done # examine the log and use ^C when done
 journalctl -xef journalctl -xef
 +
 # turn it off # turn it off
 firewall-cmd --set-log-denied=off firewall-cmd --set-log-denied=off
 firewall-cmd --get-log-denied firewall-cmd --get-log-denied
 +</code>
 +
 +===== Too many routes =====
 +
 +If you find that there are so many routes from ripv2 that you can hardly keep track of your own routing configuration, consider the following changes.
 +
 +The 2 required ampr routes to point to all of ampr can be configured in the ampr0.nmconnection file like this:
 +<code>
 +[ipv4]
 +address1=<your ip address>/9
 +route1=44.128.0.0/10
 +method=manual
 +</code>
 +
 +In order for NetworkManager and amprd not to fight, you'll need to modify the amprd.service file to start with a "network-online" target. To do this, copy the system amprd.service file into the /etc tree:
 +<code>cp /usr/lib/systemd/system/amprd.service /etc/systemd/system</code>
 +
 +Edit the /etc copy of the file and change the After directive to:
 +<code>After = network-online.target</code>
 +
 +This will let NetworkManager bring up the interface and configure it. Only after will amprd do its thing while respecting the initial configuration by NetworkManager. You'll end up with 2 44. routes that look like this:
 +<code>
 +44.0.0.0        0.0.0.0         255.128.0.0     U     450    0        0 ampr0
 +44.128.0.0      0.0.0.0         255.192.0.0     U     450    0        0 ampr0
 +</code>
 +
 +If you are outside the US, you probably know to swap the /9 and /10 subnets like so:
 +<code>
 +address1=<your ip address>/10
 +route1=44.0.0.0/9
 </code> </code>
  
 {{tag>}} {{tag>}}
  
-~~LINKBACK~~ +~~DISCUSSION~~
-//~~DISCUSSION~~+
Contact Us blog/2024/0517_amprd_on_fedora_40.1716053912.txt.gz · Last modified: (external edit)