Setting up a network at home. Setting up a network at home Setting up a local network

Let's look at setting up a PPPoE connection in operating system Fedora 17 with Gnome shell.

First, you need to give your account Administrator rights.


To unlock you need to enter the administrator password account, or root password user.

We change the account type to Administrator, after which you need to log out and log in again.

We check that the wired connection is enabled and the network card has received an IP address and other network parameters.

We check that the mac address is selected in the device MAC address field and remember the name of the connection (em1), we will need it later.

Method No. 1

Connection setup

This method is suitable if you do not use local resources simultaneously with the Internet (that is, either local resources or the Internet will work).

Open Overview – Applications – Other – Network Connections.

In the window that opens, go to the last DSL tab and add a new connection.

Check the Connect automatically checkbox and enter your Username and Password.

Go to the second tab and select a wired connection (em1) from the device MAC address drop-down list.

Save the connection and close the Network connections window.

Starting a connection

Click on the network icon and turn on the newly created connection.

As you can see, you can enable either a physical connection (System em1) - in this case local resources will work, or a pppoe connection (DSL connection 1) - the Internet will work.

If the connection is not established, you need to check the MAC address, the entered Username and Password, as well as the balance on the personal account (no blocking for non-payment).

Method No. 2

Connection setup

This method is suitable for experienced users. First, we set up the connection using the first method, after which you need to install the rp-pppoe package, because Some editions of Fedora 17 do not have it. Open Overview - Applications - System and add the Terminal to your favorites, because it will be needed often, and we launch it.

In the window that opens, type su Enter the root user password.

Install the rp-pppoe package. Team yum install rp-pppoe

We confirm the installation.

The installation is complete. Let's start setting up the pppoe connection, command pppoe-setup

Enter the username for your account in Mobile Trend.

We enter interface em1 – the same Wired connection (System em1).

Select no – so that the connection works constantly.

DNS servers should be obtained automatically, write server

Enter the password for your account in Mobile Trend.

Re-enter the password.

We allow regular users to start and stop the connection.

In a normal situation, select 0 – no firewall.

Select yes – launch this connection at system startup.

Apply and save the settings.

The setup is complete.

After this, restart the computer. We delete the DSL connection in Network Connections, or switch to Wired (System em1).

Starting a connection

Launch Terminal and enter sudo /sbin/ifupppp0

Enter the password for our account in the system.


We check the connection status with the command sudo /sbin/pppoe-status

The connection is working.

Thus, the connection must be started every time the system starts.

Only lazy people haven’t written on this topic, but I think I won’t be mistaken if I say that this question is in the first place for beginners and every beginner asked such a question. So that I don’t have to explain to everyone what and how I’m writing this article. So

How to Set Up a Home Grid .

Let's assume that you have two or more computers at home and you would like to connect them into a single infrastructure. This does not require a lot of effort and reading a bunch of manuals and other things. In fact, the most difficult thing is the physical connection of the network.The very first thing you must decide is which device will become the main one on the network, it can be a desktop computer in the form of a desktop or laptop that you touch less than all other devices, or WiFi device. Quite popular and available on this moment WiFi access points supporting Internet access protocols used by most providers. The network diagram in this case is shown in Figure 1. In this case, the network cable is connected to a WiFi point and it is also a router that distributesInternet for computers and devices. This connection is the most convenient and quick to set up, but it requires installing WiFi in all devices, which can be very expensive. In this case, the settings on the devices are minimal, and if the DHCP server is enabled on the WiFi router, then everything network settings can be set automatically. I will describe the network setup for the second type of connection shown in Figure 2. Here the main distribution and configuration server is a home desktop, it has two network cards s (it often happens that they are built into motherboard on modern models) and the wireless router is connected to it by wire. This system convenient because you don’t need to install it on your desktop wireless card, which reduces the cost this network. The DHCP server will run on the main desktop, which will make it more difficult for a potential attacker to obtain network parameters. After you connect all devices physically, let's start setting up software. Let's select addresses for the internal network. Let the address of the main computer be 10.12.0.1 maskit will be 255.255.255.0. Let's specify this parameter for the network interface connected with WiFi device. Right click on the appletNetwork Manager in the system tray, bring up the windowchanging network parameters. Typically Network Managercreates network interfaces for existing network cards with the names system eth0 and system eth1. Select the one you are looking at on your WiFi device. And click the change button. In the window that opens, go to the IPv4 tab and select “Manual” from the Method list. In the "Addresses" field that has become active, specify the selected addresses as in Figure 3. Specify the gateway as 0.0.0.0, because a gateway is not needed for this interface. Click "Apply". Configure your Internet connection on the second interface using Network Manager.

Now let's configure a DHCP server based on the dnsmasq daemon. You can skip this step, but then you will have to register all the network parameters for each device separately; if there are few devices, you can skip setting up this daemon. You can also configure a DHCP server on your device, then you should refer to the instructions for the device. If you still want to get completely automatic system then we’ll configure the daemon. First, let's install the daemon if it is not installed on the system:


Now you should add the following parameters to the daemon config along the path /etc/dnsmasq.conf:
no-negcache
dhcp-authoritative
resolv-file=/etc/resolv.conf
domain-needed
bogus-priv
filterwin2k
domain=home.net
local=/home.net/
dhcp-option=1,255.255.255.0
dhcp-option=3,10.12.0.1
dhcp-option=home.net, 6,10.12.0.1
dhcp-option=home.net,44,10.12.0.1
dhcp-range=home.net,10.12.0.15,10.12.0.50,15m
These directives have the following meaning:

This option disables negative caching of DNS requests, that is, if the host is unknown, then our server will try to find it every time. If you want the server to remember unknown domains and not try to find them, remove this option.

This option indicates that this server is the only one on the network and requests from others will not be accepted.

This directive prohibits sending requests from clients to servers higher in position on the network if incomplete Domain name(Useful if there are Windows machines on the network that suffer from this)

The directive forces the server to respond “no such domain” for a reverse domain lookup within the network and not send the request to the upstream server.

Filtering curved requests from Windows systems to upstream servers (for Windows machines)

Let's indicate our internal network domain, you can specify any one. Devices that will be connected will thus receive names within the network like device.home.net or nout.home.net depending on the device name.

The directive means that this domain is local.
The following directives will be assigned to clients' network interests:

Network mask for clients

The default gateway for clients, in our case this is the IP address of the main desktop.
dhcp-option=home.net, 6,10.12.0.1

DNS server for clients, in our case this is the main desktop. You can also specify an external DNS issued by the provider, but then names for devices connected to the network will not be resolved.
dhcp-option=home.net,44,10.12.0.1

NetBios network server, for Windows machines or SAMBA servers.
dhcp-range=home.net,10.12.0.15,10.12.0.50,15m

Well, the range of selected addresses from which addresses for the network will be distributed.

Now start the daemon with the command


And enable it to start automatically when you start your computer

If you decide to set network parameters for devices manually, then set the following network parameters for your WiFi device:
IP 10.12.0.2
netmask 255.255.255.0
network gateway 10.12.0.1
You should also configure the settings on your devices in a similar way. In addition, on devices that need Internet access via a desktop, you should specify DNS address 10.12.0.1.
If you have configured the dnsmasq server, configure your device to automatically obtain an IP address and other network parameters via DHCP (to do this, refer to the instructions for your device) and simply connect it to the network interface. After some time, the device should receive network parameters, and an entry will appear in /var/lib/dnsmasq/dnsmasq.leases indicating which address the device received. If this does not happen, carefully examine the log /var/log/messages, usually there are problems with SeLinux enabled or errors in the configuration file. Don't forget to disable the DHCP function, if any, in your WiFI device so that it does not interfere.
At this point, you can try to connect other devices to the network. They must ping each other and see each other by name.
The next step is setting up Internet distribution to other devices. To do this, you need to enable packet routing between interfaces, and configure the firewall to forward packets from local network in Internet. The first task can be solved by enabling IP forwarding on the main desktop; to do this, correct the net.ipv4.ip_forward parameter in the /etc/sysctl.conf file from 0 to 1:This option specifies that forwarding should be enabled on this system, but it is only enabled after a reboot, so you should reboot the computer or use the following command as root to manual installation required parameter systems:
#echo 1 > /proc/sys/net/ipv4/ip_forward

Next, you should configure the firewall to masquerade the network; for this you can use GUI, located along the path System\Administration\Firewall. Check the boxes next to your interface to which the WiFi device is connected in the Trusted devices section, and also in the Masquerade section, indicate the devices through which the Internet should be distributed within the network. Don't forget to turn it on with the appropriate button if you have it disabled, and apply the changes. Now you can try connecting your devices to WiFi and accessing the Internet.

Actually this setting It is quite general and most other forms of networks can be configured in a similar way. In general, there is nothing complicated in such a setup, and all the information is easily available on the Internet. Good luck!

Only lazy people haven’t written on this topic, but I think I won’t be mistaken if I say that this question is in the first place for beginners and every beginner asked such a question. So that I don’t have to explain to everyone what and how I’m writing this article. So

How to Set Up a Home Grid .

Let's assume that you have two or more computers at home and you would like to connect them into a single infrastructure. This does not require a lot of effort and reading a bunch of manuals and other things. In fact, the most difficult thing is the physical connection of the network.The very first thing you must decide is which device will become the main one on the network, it can be a desktop computer in the form of a desktop or laptop that you touch less than all other devices, or a WiFi device. WiFi access points with support for Internet access protocols used by most providers are quite popular and available at the moment. The network diagram in this case is shown in Figure 1. In this case, the network cable is connected to a WiFi point and it is also a router that distributesInternet for computers and devices. This connection is the most convenient and quick to set up, but it requires installing WiFi in all devices, which can be very expensive. In this case, the settings on the devices are minimal, and if the DHCP server is enabled on the WiFi router, then all network settings can be set automatically. I will describe the network setup for the second type of connection shown in Figure 2. Here, the main distribution and configuration server is a home desktop, it has two network cards installed (it often happens that they are built into the motherboard on modern models) and a wireless router is connected to it wire. This system is convenient because you do not need to install a wireless card in the desktop, which reduces the cost of this network. The DHCP server will run on the main desktop, which will make it more difficult for a potential attacker to obtain network parameters. After you connect all devices physically, let's start setting up the software. Let's select addresses for the internal network. Let the address of the main computer be 10.12.0.1 maskit will be 255.255.255.0. Let's specify this parameter for the network interface connected with WiFi device. Right click on the appletNetwork Manager in the system tray, bring up the windowchanging network parameters. Typically Network Managercreates network interfaces for existing network cards with the names system eth0 and system eth1. Select the one you are looking at on your WiFi device. And click the change button. In the window that opens, go to the IPv4 tab and select “Manual” from the Method list. In the "Addresses" field that has become active, specify the selected addresses as in Figure 3. Specify the gateway as 0.0.0.0, because a gateway is not needed for this interface. Click "Apply". Configure your Internet connection on the second interface using .

Now let's configure a DHCP server based on the dnsmasq daemon. You can skip this step, but then you will have to register all the network parameters for each device separately; if there are few devices, you can skip setting up this daemon. You can also configure a DHCP server on your device, then you should refer to the instructions for the device. If you still want to get a fully automatic system, then we’ll set up a daemon. First, let's install the daemon if it is not installed on the system:


Now you should add the following parameters to the daemon config along the path /etc/dnsmasq.conf:
no-negcache
dhcp-authoritative
resolv-file=/etc/resolv.conf
domain-needed
bogus-priv
filterwin2k
domain=home.net
local=/home.net/
dhcp-option=1,255.255.255.0
dhcp-option=3,10.12.0.1
dhcp-option=home.net, 6,10.12.0.1
dhcp-option=home.net,44,10.12.0.1
dhcp-range=home.net,10.12.0.15,10.12.0.50,15m
These directives have the following meaning:

This option disables negative caching of DNS requests, that is, if the host is unknown, then our server will try to find it every time. If you want the server to remember unknown domains and not try to find them, remove this option.

This option indicates that this server is the only one on the network and requests from others will not be accepted.

This directive prohibits sending requests from clients to servers higher up the network if the full domain name is not specified (useful if there are Windows machines on the network that suffer from this)

The directive forces the server to respond “no such domain” for a reverse domain lookup within the network and not send the request to the upstream server.

Filtering curved requests from Windows systems to higher-level servers (for Windows machines)

Let's indicate our internal network domain, you can specify any one. Devices that will be connected will thus receive names within the network like device.home.net or nout.home.net depending on the device name.

The directive means that this domain is local.
The following directives will be assigned to clients' network interests:

Network mask for clients

The default gateway for clients, in our case this is the IP address of the main desktop.
dhcp-option=home.net, 6,10.12.0.1

DNS server for clients, in our case this is the main desktop. You can also specify an external DNS issued by the provider, but then names for devices connected to the network will not be resolved.
dhcp-option=home.net,44,10.12.0.1

NetBios network server, for Windows machines or SAMBA servers.
dhcp-range=home.net,10.12.0.15,10.12.0.50,15m

Well, the range of selected addresses from which addresses for the network will be distributed.

Now start the daemon with the command


And enable it to start automatically when you start your computer

If you decide to set network parameters for devices manually, then set the following network parameters for your WiFi device:
IP 10.12.0.2
netmask 255.255.255.0
network gateway 10.12.0.1
You should also configure the settings on your devices in a similar way. In addition, on devices that need Internet access via a desktop, you should specify the DNS address 10.12.0.1.
If you have configured the dnsmasq server, configure your device to automatically obtain an IP address and other network parameters via DHCP (to do this, refer to the instructions for your device) and simply connect it to the network interface. After some time, the device should receive network parameters, and an entry will appear in /var/lib/dnsmasq/dnsmasq.leases indicating which address the device received. If this does not happen, carefully examine the log /var/log/messages, usually there are problems with SeLinux enabled or errors in the configuration file. Don't forget to disable the DHCP function, if any, in your WiFI device so that it does not interfere.
At this point, you can try to connect other devices to the network. They must ping each other and see each other by name.
The next step is setting up Internet distribution to other devices. To do this, you need to enable packet routing between interfaces, and configure the firewall to forward packets from the local network to the Internet. The first task can be solved by enabling IP forwarding on the main desktop; to do this, correct the net.ipv4.ip_forward parameter in the /etc/sysctl.conf file from 0 to 1:This option specifies that forwarding should be enabled on this system, but it is only enabled after a reboot, so you should reboot the computer or use the following command as root to manually set the desired system parameter:
#echo 1 > /proc/sys/net/ipv4/ip_forward

Next, you should configure the firewall to masquerade the network; for this you can use the graphical interface located on the path System\Administration\Firewall. Check the boxes next to your interface to which the WiFi device is connected in the Trusted devices section, and also in the Masquerade section, indicate the devices through which the Internet should be distributed within the network. Don't forget to turn it on with the appropriate button if you have it disabled, and apply the changes. Now you can try connecting your devices to WiFi and accessing the Internet.

In general, this setting is quite general and most other forms of networks can be configured in a similar way. In general, there is nothing complicated in such a setup, and all the information is easily available on the Internet. Good luck!

My first contact with Linux took place about six years ago. Then it was some kind of freshly released Red Hat, which my friend and I were able to install, but we still couldn’t get into it.
However, this is not what the article is about. Later, almost all families passed through my hands and head Linux distributions, and everywhere I noticed my approaches to auto-configuring the network. And in this series of articles I will try to highlight the most popular of them. I hope they will be useful to those users who are still clicking on buttons and checking boxes in graphical settings managers, but already understand that this is not true :)
Perhaps these articles will also be informative for those who (not out of great knowledge) write their own network management scripts and place them in some rc.local

For the above tunnel, these files might look like this.

rule-tun0:
from 10.0.0.2 lookup mytable

route-tun0:
default dev tun0 table mytable
192.168.0.0/24 dev tun0

By creating these files, we relieve ourselves of the headache of having to ensure that the corresponding rules and routes are created and deleted when raising and lowering the interface, respectively.

Another interesting possibility - automatic creation aliases. If you have an eth0 interface with the address 192.168.0.1, and you want to add 192.168.0.2, then just create a file ifcfg-eth0:1, where you can enter, in addition to the above parameters (IPADDR, NETMASK, and so on), one more - REALDEVICE =eth0.
If suddenly there is a need to create a large number of aliases, but you don’t want to create separate files for each, then there is a way out: ifcfg-eth0-range will save us, which can look like this:
IPADDR_START=192.168.0.5
IPADDR_END=192.168.0.15
CLONENUM_START=3

This example will create interfaces eth0:3 - eth0:13 with addresses from 192.168.0.5 to 192.168.0.15.

And finally, we can’t help but mention the ifup.d and ifdown.d directories, located there (in /etc/sysconfig/network-scripts).
In these directories you can place your files, which will be executed when the interface is raised and lowered. Your scripts will be passed one parameter $1 - this is the name of the interface that was raised or lowered.

Having a network configured according to these principles, you can always raise/lower a separate interface with the command ifup name (ifdown name), where name is your interface. To reboot the entire network, just type service network reload.

My first contact with Linux took place about six years ago. Then it was some kind of freshly released Red Hat, which my friend and I were able to install, but we still couldn’t get into it.
However, this is not what the article is about. Later, almost all families of Linux distributions passed through my hands and head, and everywhere I noticed my approaches to network auto-configuration. And in this series of articles I will try to highlight the most popular of them. I hope they will be useful to those users who are still clicking on buttons and checking boxes in graphical settings managers, but already understand that this is not true :)
Perhaps these articles will also be informative for those who (not out of great knowledge) write their own network management scripts and place them in some rc.local

For the above tunnel, these files might look like this.

rule-tun0:
from 10.0.0.2 lookup mytable

route-tun0:
default dev tun0 table mytable
192.168.0.0/24 dev tun0

By creating these files, we relieve ourselves of the headache of having to ensure that the corresponding rules and routes are created and deleted when raising and lowering the interface, respectively.

Another interesting feature is the automatic creation of aliases. If you have an eth0 interface with the address 192.168.0.1, and you want to add 192.168.0.2, then just create a file ifcfg-eth0:1, where you can enter, in addition to the above parameters (IPADDR, NETMASK, and so on), one more - REALDEVICE =eth0.
If suddenly there is a need to create a large number of aliases, but you don’t want to create separate files for each, then there is a way out: ifcfg-eth0-range will save us, which can look like this:
IPADDR_START=192.168.0.5
IPADDR_END=192.168.0.15
CLONENUM_START=3

This example will create interfaces eth0:3 - eth0:13 with addresses from 192.168.0.5 to 192.168.0.15.

And finally, we can’t help but mention the ifup.d and ifdown.d directories, located there (in /etc/sysconfig/network-scripts).
In these directories you can place your files, which will be executed when the interface is raised and lowered. Your scripts will be passed one parameter $1 - this is the name of the interface that was raised or lowered.

Having a network configured according to these principles, you can always raise/lower a separate interface with the command ifup name (ifdown name), where name is your interface. To reboot the entire network, just type service network reload.