I am establishing a Debian server to behave as each a router and a server, however I’ve encountered points with my ISP’s distinctive static IP task technique. Here is the state of affairs:
I’ve been assigned two static IPs: 66.161.243.109
and 66.161.243.110
with a subnet masks of 255.255.255.252
. My objective is to assign 66.161.243.109
to the Debian server.
The Drawback:
My ISP makes use of a way known as subnet routing (or IP tackle delegation) as a substitute of straight assigning static IPs to the router’s WAN interface. The router dynamically receives an IP tackle that serves because the gateway for the static IP block. Static IPs are routed by this dynamic WAN IP fairly than being assigned on to the router.
This primarily implies that:
- The static IPs are configured on units behind a router.
- The WAN IP dynamically assigned to a router by the ISP is used as a gateway for the static IPs.
I perceive this setup conceptually, however I’m having hassle making it work in follow.
Present Configuration:
Right here is my /and so forth/community/interfaces
setup:
# The loopback community interface
auto lo
iface lo inet loopback
# The first community interface
allow-hotplug eno1
iface eno1 inet dhcp
pre-up iptables-restore < /and so forth/community/iptables.guidelines
# Digital interfaces for static IP addresses on eno1
auto eno1:1
iface eno1:1 inet static
tackle 66.161.243.109
netmask 255.255.255.252
# The 2nd community interface as DHCP router
auto eno2
iface eno2 inet static
tackle 192.168.1.1
netmask 255.255.255.0
What I’ve Tried:
To make sure outbound packets use the static IP tackle, I added this iptables rule:
iptables -t nat -A POSTROUTING -o eno1 -j SNAT --to-source 66.161.243.109
Nonetheless, this triggered:
- 100% packet loss when making an attempt to
ping
exterior addresses. curl ifconfig.me
hangs indefinitely.
I’ve tried numerous configurations and workarounds, however I have never been in a position to make it work.
Query:
- How can I configure my Debian server to correctly use
66.161.243.109
for outgoing site visitors whereas conservingeno1
purposeful with the ISP’s dynamically assigned IP? - Do I want to regulate routing, NAT, or iptables settings to make this work?
- Alternatively, am I compelled to make use of a devoted router between the modem and my server to make use of the static IP addresses?
Any steerage or insights can be drastically appreciated!