Managing and Directing Network Traffic with Linux Oscar Mederos
Network Architecture Networks are interconnected through routers and gateways A router interconnects 2 networks A gateway defines the start of a network All gateways are routers, not all routers are gateways
TCP/IP traffic routing in Linux Edit /etc/sysctl.conf & uncomment net.ipv4.ip_forward=1 Your computer can now route packets! Define your interfaces in /etc/networking/interfaces Set eth0 to dhcp, eth1 to static & assign it an IP
Kernel modules Enable the following kernel modules ip_tables nf_conntrack nf_conntrack_ftp iptable_nat nf_nat_ftp
IP chains & the gateway Set IP chains to NAT packets & allow traffic re- direction from eth0 to eth1 -A POSTROUTING -o "eth1" -j MASQUERADE -A FORWARD -i "eth0" -o "eth1" -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT -A FORWARD -i "eth0" -o "eth1" -j ACCEPT -A FORWARD -j LOG
Host configurations In linux route add default gw *eth1 IP In windows visit your connection settings for tcp/ip and point your gateway to the IP of the linux host we just set up as a gateway All hosts must have IP addresses on the same network as the router's internal network interface
Quagga Quagga is a network routing software suite providing implementations of Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP)
Quagga The Quagga architecture consists of a core daemon (zebra) which is an abstraction layer to the underlying Unix kernel and presents the Zserv API over a Unix-domain socket or TCP socket to Quagga clients. The Zserv clients typically implement a routing protocol and communicate routing updates to the zebra daemon.