How to configure a static wildcard subdomain with dnsmasq

I do the exact same thing on my dev server(s) so that I can have an rsynced mirror locally and on the off-site server with identical configs. Here’s what you need in your dnsmasq.conf (make sure you restart it) assuming your webserver’s internal interface is 192.168.0.3: address=/.server.mydomain.com/192.168.0.3 This will create a wildcard entry for *.server.mydomain.com … Read more

Create a multi-homed linux load balancer with two internet connections and one LAN connection

With the assistance of a few friends helping me research this, I was FINALLY able to get it working. Had to run this script in order to properly forward TCP/IP traffic: #!/bin/sh PATH=/usr/sbin:/sbin:/bin:/usr/bin # Primary Connection – 2085426230 IF1=eth0 IP1=172.16.0.2 P1=172.16.0.1 P1_NET=172.16.0.0 # Secondary Connection – 2085420213 IF2=eth1 IP2=172.16.1.2 P2=172.16.1.1 P2_NET=172.16.1.0 # Local Network IF3=eth2 … Read more

Load balancing & NAT-ing multiple ISP connections on Linux

I have done load balancing using both lartc.org and iptables methods, and I find that the iptables method is easier to understand and implement. The only downside is that you need a fairly recent iptables version to be able to use statistic module Let’s suppose a few things: LAN: eth0: 192.168.0.1/24 ISP1: eth1: 192.168.1.1/24, gateway: … Read more

Exposing multiple servers behind NAT using a single public IP address

You’re getting muddled in your thinking about how information flows between the layers of the TCP/IP protocol stack– between DNS and application layer protocols, specifically. You have one public IP address. Your DNS can certainly resolve both mail.example.com and example.com to the same public IP address. In general, the IP datagrams containing requests to your … Read more

How to configure a custom NAT for use in Amazon VPC

You can check Amazon’s script to configure NAT on a Linux machine, it comes with their default ami-vpc-nat AMI, in /usr/local/sbin/configure-pat.sh It looks like this: #!/bin/bash # Configure the instance to run as a Port Address Translator (PAT) to provide # Internet connectivity to private instances. function log { logger -t “vpc” — $1; } … Read more

What is strict, moderate and open NAT?

It’s important first to know how Network Address Translation (NAT) works. You establish a connection to a server on the internet. In reality you send packets to your router, going out from your computer on some randomly chosen port: Your computer Router ╔════════════╗ ╔═══════════╗ ║ ║ ║ ║ ║ port 31746 ╫====>╫ ║ ║ ║ … Read more

Ping: sendmsg: operation not permitted error after installing iptables on Arch GNU/Linux

The error message: Ping: sendmsg: operation not permitted means that your server is not allowed to send ICMP packets. You need to allow your server to send traffic via one or more of the configured interfaces. You can do this by: Set OUTPUT chain policy to ACCEPT to allow all outgoing traffic from your box: … Read more

Are people really going to use public IPv6 addresses on their private networks? [duplicate]

Is that how IPv6 is intended to work? In short, yes. One of the primary reasons for increasing the address space so drastically with IPv6 is to get rid of band-aid technologies like NAT and make network routing simpler. But don’t confuse the concept of a public address and a publicly accessible host. There will … Read more