From ed3b77d08fc90fe5c65b0c7f8fe89b058fffd155 Mon Sep 17 00:00:00 2001 From: "Michael H.G. Schmidt" Date: Fri, 21 Jul 2023 22:59:40 +0200 Subject: [PATCH] . --- .../{ipfire_ipalias.txt => ipfire_ipalias.md} | 25 ++++++++++++------- ...lias_green.txt => ipfire_ipalias_green.md} | 12 ++++++--- 2 files changed, 24 insertions(+), 13 deletions(-) rename migrate/{ipfire_ipalias.txt => ipfire_ipalias.md} (60%) rename migrate/{ipfire_ipalias_green.txt => ipfire_ipalias_green.md} (72%) diff --git a/migrate/ipfire_ipalias.txt b/migrate/ipfire_ipalias.md similarity index 60% rename from migrate/ipfire_ipalias.txt rename to migrate/ipfire_ipalias.md index 4c3db8e..ca32046 100644 --- a/migrate/ipfire_ipalias.txt +++ b/migrate/ipfire_ipalias.md @@ -1,25 +1,29 @@ -====== Howto add IP aliases on ppp0 in IPfire ====== +# Howto add IP aliases on ppp0 in IPfire Let's say you have a /29 network on your DSL subscriber (dial) line: 212.218.10.64/29. In that case you could use six ip adresses (65 to 70) as public addresses for machines or services behind your firewall. -According to this [[https://community.ipfire.org/t/adding-aliases-to-red-interface/552|thread]] and this [[https://community.ipfire.org/t/a-red-interface-in-pppoe-and-have-two-public-ip/8014|thread]] it is not possible. But it is possible - and i will show you how. +According to this [thread](https://community.ipfire.org/t/adding-aliases-to-red-interface/552) and this [thread](https://community.ipfire.org/t/a-red-interface-in-pppoe-and-have-two-public-ip/8014|thread) it is not possible. But it *is* possible - and i will show you how. -1.) Enable SSH access in ipfire and connect to ipfire as root. -2.) Add the following lines to the file /var/ipfire/ethernet/aliases: +## 1.) Enable SSH access in ipfire and connect to ipfire as root. +## 2.) Add the following lines to the file /var/ipfire/ethernet/aliases: + +```bash 212.218.10.65,on,RED2 212.218.10.66,on,RED3 212.218.10.67,on,RED4 212.218.10.68,on,RED5 212.218.10.69,on,RED6 212.218.10.70,on,RED7 +``` -3.) Create a new file (this will configure your ip addresses) +## 3.) Create a new file (this will configure your ip addresses) /etc/rc.d/init.d/networking/red.up/02-aliases: +```bash ip addr add 212.218.10.65/29 dev ppp0 ip addr add 212.218.10.66/29 dev ppp0 ip addr add 212.218.10.67/29 dev ppp0 @@ -27,12 +31,15 @@ According to this [[https://community.ipfire.org/t/adding-aliases-to-red-interfa ip addr add 212.218.10.69/29 dev ppp0 ip addr add 212.218.10.70/29 dev ppp0 ip addr show ppp0 +``` -4.) Make it executable! +## 4.) Make it executable! - chmod 0755 /etc/rc.d/init.d/networking/red.up/02-aliases +```bash + hmod 0755 /etc/rc.d/init.d/networking/red.up/02-aliases +``` -5.) Restart your Internet connection +## 5.) Restart your Internet connection READY. @@ -41,4 +48,4 @@ READY. - You can use the new addresses in the firewall config - they will appear as RED2 - RED7 - The warning "Aliases will not be active unless your RED interface is STATIC" can be safely ignored from now on -Have fun ;-) \ No newline at end of file +Have fun ;-) diff --git a/migrate/ipfire_ipalias_green.txt b/migrate/ipfire_ipalias_green.md similarity index 72% rename from migrate/ipfire_ipalias_green.txt rename to migrate/ipfire_ipalias_green.md index 0609059..9850785 100644 --- a/migrate/ipfire_ipalias_green.txt +++ b/migrate/ipfire_ipalias_green.md @@ -1,19 +1,23 @@ -====== Howto add a IP alias on the "green" interface in IPfire ====== +# Howto add a IP alias on the "green" interface in IPfire Let's say you have a an internal /24 network and you want to add a secondary (local) IP address (this could be useful in case you remove an old machine from the network and your new firewall is on a different address - but your new firewall should offer on of it's services on the old address). In the ipfire GUI this is not possible. But you can use the file "rc.local" (which is executed while the firewall boots). -1.) Add the following lines to the file /etc/sysconfig/rc.local: +## 1.) Add the following lines to the file /etc/sysconfig/rc.local: +```bash ip addr add 192.168.89.1/24 dev green0 ip addr show green0 +``` -2.) Make it executable: +## 2.) Make it executable: +```bash chmod 0755 /etc/sysconfig/rc.local +``` -3.) Reboot your firewall or execute the script manually +## 3.) Reboot your firewall or execute the script manually READY.