In this article you will learn how to use iptables to configure the system with Ubuntu and Debian for Rasta

11 january 2017, 07:51

  • Rating:
  • (0 / 5)
In this article you will learn how to use iptables to configure the system with Ubuntu and Debian to distribute Internet to other computers in the local network. A simple example will be shown as a machine with two network interfaces into a single enters the Internet from another goes out to make a gateway. Assume that the hardware and the network part is already configured on your machine are working online and you see other computers on the network. So let's see what's what for this enter ifconfig It will return a list of currently running network interfaces. Among them it is necessary to identify those that begin with the words encapEthernet Link interface network cards. Usually it is eth0 and eth1. Now you will need to identify which one goes online and what goes. The easiest way to do it by their ip addresses. So for example using eth0 you get on the Internet for example via an adsl modem using the ppp Protocol and eth1 connects you with the local network. If the local network is configured via Network Manager, we recommend you to specify these settings directly in the system configuration file network sudo nano etcnetworkinterfaces Here correct the settings of your network interface connected to the local network in our case eth1 as appropriate auto eth1 iface eth1 inet static address 192.168.0.10 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 The address value is the IP of your machine in the local network, this address actually will be the gateway. The value of the netmask of the local network for this range often is. For other ranges can be calculated here. The values of the network and broadcast will depend on your address. That is, if your local ip is 10.0.0.10 network and will be broadcast 10.0.0.0 and 10.255.255.255, respectively. Or it can be done with just one command sudo ifconfig eth1 192.168.0.10 This command is to configure your network card eth1 to use static IP addresses and will prescribe the above-described settings in the file etcnetworkinterfaces In any case, after these changes, restart networking sudo etcinit.dnetworking restart Team ifconfig check that the changes took effect and everything works. Now remains the case for small. If you have already tried to configure your system gateway but you could not or for some other reason you want to reset all the settings of the firewall iptables it can be done with the following commands iptables --flush iptables --table nat --flush iptables --delete-chain iptables --table nat --delete-chain If direct the need to reset iptables not then better not to do it. The following commands will set up your iptables for NAT translation NAT Network Address Translation network address translation through the Ubuntu gateway sudo iptables-A FORWARD -i eth0 -o eth1 -s 192.168.0.024 -m conntrack --ctstate NEW-j ACCEPT sudo iptables-A FORWARD -m conntrack --ctstate ESTABLISHEDRELATED -j ACCEPT sudo iptables -A POSTROUTING -t nat -j MASQUERADE If you need network interfaces different from the

  Save as PDF

  Save as image


Comments and reviews (0)

Add comment

Please rate it between 1 and 5

Read also:

To display install the latest version of Flash Player.

About the store

Promotions and discount offers

Website to IP telephony Communication does not have to be expensive Connection of additional local numbers IP Protocol.

New items News Turnkey solutions Events Past events

3G & 4G LTE

Aggregators and payment gateways Catalog aggregators of payment systems and the companies that provide the ability to connect the payment gateway to the website of the online store.

Sign a contract for a year and receive a complimentary IPad Air.

Corporate Internet gateway

"Information Security" "IT Secu

Subscription service computers organizations

Installing debian 7 on the Internet gateway

Tool solve your problems

DrWeb Internet Gateway Security Suite protection of Internet gateways

Try the Microsoft Edge — fast & secure browser designed for

VOIP and GSM gateways

The Internet gateway Ask question

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-virtua This (and better understood

Internet gateway Debian-CBS in St. Petersburg Internet gateway Debian CBS for small and medium businesses

The 300-thousandth article about Internet gateway

The Internet gateway

The Internet gateway

How to know the IP address of the Internet gateway (default gateway)

pfsense is also one of the more popular distributions to create a Internet gateway (firewall).

Dr. Web for Internet gateways Unix

Kaspersky Security for Internet gateways

Blog By Vladimir Stepanov The 300-thousandth article about Internet gateway

Available for all programming

Internet gateway Ideco ICS 4www.ideco.ru © 2005-2012 Internet gateway Ideco ICS 4 for Your company! - presentation

Network gateway

Lan2net NAT Firewall - NAT

Internet gateway Ideco ICS (Ideco Internet Control Server) is a software solution which allows

The Internet gateway

Internet gateway Internet Control Server

CharmLab Multimedia Menu Internet gateway for Linux to share an Internet connection in LAN Recent entries IT themes Sponsors Label

Secure Internet gateway: is it possible import substitution?

What is needed and how to find out default gateway

This utility configures your system to work in as the Internet gateway for the other machines

Internet gateway Ideco ICS

Step-by-step router configuration on Debian 8 jessie

Internet gateway Internet Control Server

The 300-thousandth article about Internet gateway

New member Posts: 3 Thanks: 0

Internet gateway

Choose a proxy server or gateway for the company

What gateways are and how they work

Installing the Internet gateway Ubuntu

Internet gateway on Ubuntu Server / Internet Connection Sharing + Squid, Firestarter Internet sharing to the local network using firestarter Internet sharing in LAN (ICS: Internet Connection Sharing)