Suppose we have a local area network with a switch and multiple computers plus an internet provider.
Types of connection to the Internet of the user from providers:
Connection via ADSL modem
Twisted pair or fiber optic connection
Connect via USB modem 3G (not considering as never had to use this method on the server, but configured connection via ppp)
Connection via WIMAX router (receive the Internet from the provider on the router and give a twisted pair to our server - it turns out that the connection is configured as a twisted pair)
Other kinds of connections.
The simplest and most reliable is a twisted pair.
The provider brings you an internet cable to the server and must also provide you with connection settings such as:
IP address
The net mask
Gateway network
DNS address of provider
The worse option is when you provider provides Internet via VPN, that is, through a network cable you must connect to the provider's server and get the Internet already from the server, for this it is necessary to configure a VPN server, this is certainly not a problem but with the console and without experience tinkering a little.
A very common option to get the Internet through a telephone line using an ADSL modem, for this you can configure the modem in two bridge and router modes.
router - we prescribe a login password on the modem (receive the Internet from the provider to the router and give a twisted pair to our server - it turns out that the connection is configured as a twisted pair)
Bridge. - we prescribe a login password on the server (set pppoeconf packet with the command) aptitude install pppoeconf and then connect the cable from the modem to the network run the command pppoeconf - the program automatically scans the network and if it finds a modem configures almost independently the Internet connection, enter only the login and password and agree to all conditions.
And that and that option has its pros and cons.
For example, let’s set up the Internet on a server with two network cards, the provider provides Internet over a twisted pair.
The provider provided us with the data to connect:
IP - 195.24.23.231
MASK - 255.255.255.0
GATEWAY - 195.24.23.1
DNS - 195.24.23.5 195.24.22.5
Examples of configuration files are typical for Debian, Ubuntu and their derivatives, but will work in similar ways with other Linux distributions.
We have two network cards in the server, and we will configure them.
File. /etc/network/interfaces This is what we're looking at:
# The loopback network interface
auto lo
iface lo inet loopback
# Provider network
auto eth0
iface eth0 inet static
address 195.24.23.231
netmask 255.255.255.0
gateway 195.24.23.1
# Local network
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0Add the DNS server commands:
echo 'nameserver 195.24.23.5' > /etc/resolv.conf echo 'nameserver 195.24.22.5' >> /etc/resolv.conf
Make sure that the cables from the provider and from the local network are connected to the network cards.
Reboot the server network with the command:
/etc/init.d/networking restart
Or overload the entire server with a command:
reboot
Check the Internet by letting ping into the Internet on the server ya.ru team:
ping ya.ru
In order to interrupt the ping, you need to press CTRL+C
If the ping goes, then the Internet on the server is working.
Similarly, we check and ping on any machine in the local network by prescribing instead of ya.ru ip address of the computer, for example 192.168.1.5
Supplement.
If you need to install programs from the repository via apt-get, aptitude or wget, and your Internet is available through a proxy server, you need to configure Debian or Ubuntu systems through a proxy. To do this, you need to perform under the user root two teams:
export http_proxy=http://login:[email protected]:8080/ export ftp_proxy=ftp://login:[email protected]:8080/
You need to replace the login and password with your own.
If you do not have a password and IP, enough of these 2 commands:
export http_proxy=http://192.168.1.1:8080/ export ftp_proxy=ftp://192.168.1.1:8080/
This is enough for apt-get, aptitude, wget to work through a proxy server.
You can just configure NAT on the first server for the right IP like mine. articleBut only if your proxy is not transparent. If you are as transparent as mine. articleThen you have to follow the previous commands.
You can use 2 methods, that is, use the transfer of 80 ports to a proxy, and allow other ports for a certain camp via NAT, then you will keep records of who went where in the browser, but torrents and mail will work directly and will not be taken into account in the proxy.
There's a lot of options.
A simple example of setting up the Internet on the server I described, if you need to expand any of the types of connections please write a request in comments.
I was with you. Sergey Lazarenko.



comment