Monday, May 2, 2016

Tutorial: How to Create a Router using CentOS 7

Hello and welcome to my amazing tutorial on how to configure a CentOS 7 machine into a router. This will be done in 12 EZ STEPS! Good luck.

Step 1: Add this line to your sysctl.conf file in /etc



Step 2: Find your external NIC (the one connecting you to the internet) and edit the configuration file for it, which will be located at:

/etc/sysconfig/network-scripts/[ethernet device name]

Step 3: Configure it like the image below, however, do not change the UUID or Device, as this is unique to your machine.





Step 4: Find your internal NIC (the one connecting you to the switch) and edit the configuration file for it, which will be located at the same location.

Step 5: Configure it to the image below, but do not change Name, Device, or UUID, since it's unique to you. The IPADDR is openly changeable to what you wish it to be, but I suggest leaving it like that. The HWADDR line, is also unique, and will not be the one in the image below. To find this, you must type "ip a" into the command line, then look for the MAC Address of the Internal NIC (it will look similar to the one in the image), then copy that specific address into the file on the HWADDR line.



Step 6: Install dnsmasq with the following command:

"yum install dnsmasq"

Step 7: Type the following commands (in order), to get things started:

"start dnsmasq.service"
"systemctl start dnsmasq.service"
"systemctl enable dnsmasq.service" <---- To get it enabled on boot

Step 8: Open port 53 using this command:

"Firewall-cmd --permanent --add-port=53/udp --zone=internal

Step 9: Reload the firewall like so:

"Firewall-cmd --reload"

Step 10: Quickly go onto one of your clients, and find the External NIC (which will be connected to the switch) and edit the configuration file at:

"/etc/sysconfig/network-scripts/[ethernet device name]"

Step 11: Add two new lines:

"DNS1= 8.8.8.8"
"DNS2= 8.8.4.4"

Step 12: Now you must configure DHCP. Do this:



Shoutout to: Copyright 2007-2014 Server World - All Rights Reserved
Marco Sirabella, and Jonathan from the famous blog:
jonlinuxdiz.blogspot.com

Thanks bros, and have a great day.

Copyright 1969-2069 Martin Is Awesome - No Rights Reserved