Configure Linux as a Router on RHEL5
In this tutorial you will show that how to configure Linux Machine as a Router. Routers are the devices those are used to connect two or more different networks. Routers are very costly devices. Linux could be a cost effective solution of routing in a small company.
In this practical I am using three computers. One System will be use for routing and two others will remain in two different networks. First we will configure the system which is going to play the role of router.
Pre-requisites for both Router and Other Machines:
- A Linux Machine named Linuxrouter with two different LAN card
- Two different IP address of Router Machine on two LAN Card one is 210.207.201.100 another is 192.168.161.10
- Enable IP forwarding.
- Configure both of the NIC card on Router machine.
- Two Client machine, both could be Linux or one could be Linux and another could be Windows machine
- Client Machine one IP address is 210.207.201.1 and another machine IP address is 192.168.161.1
Necessary configuration for Router Machine
IP Configuration: Change the IP address of both LAN card
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
#Broadcom Corporation Net link BCM57875 Gigabyte Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29: EB: B2: CA
ONBOOT=yes
TYPE=Ethernet
PEERDNS=no
USERCTL=no
IPV6INIT=no
IPADDR=210.207.201.100
NETMASK=255.255.255.0
NETWORK=210.207.201.0
BROADCAST=210.207.201.255
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
#Broadcom Corporation Net link BCM57875 Gigabyte Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29: EB: B2: CA
ONBOOT=yes
TYPE=Ethernet
PEERDNS=no
USERCTL=no
IPV6INIT=no
IPADDR=192.168.161.100
NETMASK=255.255.255.0
NETWORK=210.207.201.0
BROADCAST=210.207.201.255
Changing Host name: Change the host name of your Router machine as Linuxrouter.
[root@localhost ~]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=Linuxrouter
Restart or Reload the NIC card: After changing the NIC card and hosting name you have to restart the network of router machine by following this command.
[root@localhost ~]# service iptables stop
[root@localhost ~]# chkconfig iptables off
[root@localhost ~]# service network restart
Enable IP Forwarding: Enable the IP forwarding by editng /etc/sysctl.conf file. So open the File using vi editor.
[root@Linuxrouter ~]# vi /etc/sysctl.conf
Locate the net.ipv4. ip_forward =0
Replace the Value ‘0’ to 1. This will enable the IP forwarding with permanently. But this requires a system reboot.
Restart Machine: After editing the sysctl.conf file restart your machine by following command.
[root@Linuxrouter ~]# init 6
Necessary configuration for Client Machine
On windows machine: Right click on Network Place → Right click Local area connection → Select Internet Protocol (TCP/IP) → Click Properties → Select Use the following IP address then put the following IP configuration.
On Linux machine: Change the IP address of both LAN card
[root@ns1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
#Broadcom Corporation Net link BCM57875 Gigabyte Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29: EB: B2: CA
ONBOOT=yes
TYPE=Ethernet
PEERDNS=no
USERCTL=no
IPV6INIT=no
IPADDR=210.207.201.1
NETMASK=255.255.255.0
Gateway=210.207.201.100
NETWORK=210.207.201.0
BROADCAST=210.207.201.255
GATEWAY=210.207.201.100
Restart or Reload the NIC card: After changing the NIC card restart the network card by following this command.
[root@ns1 ~]# service iptables stop
[root@ns1 ~]# chkconfig iptables off
[root@ns1 ~]# service network restart
Testing the connection from both Linux and windows machine
On windows machine: Type the Following IP address on your command prompt like below, if you get this message then your router is working properly.
On Linux Machine: Open your terminal window by Right clicking on Desktop and then select Terminal.
Now the the Router is properly working.
Useful tutorial, See also : Primary DNS Server on RHEL 5.x and Configuring Yum on RHEL 5.x For Internet Access (Part-3)
ReplyDeletei cant understand in your post because so many incorrect lines are there. (eth0 and eth0:1 IPS )
ReplyDeleteI had tried to turn on IP forwarding on RHEL 5.3, but it doesn't work as expected.
ReplyDeleteAfyon
ReplyDeleteBalıkesir
Kırklareli
Amasya
Bilecik
310T4İ
Eskişehir
ReplyDeleteAdana
Sivas
Kayseri
Samsun
SRD2EM
yozgat
ReplyDeletetunceli
hakkari
zonguldak
adıyaman
SLKO8
goruntulu show
ReplyDeleteücretli
RDQTG
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
CHVC
B2B8D
ReplyDeleteAksaray Evden Eve Nakliyat
Zonguldak Parça Eşya Taşıma
İzmir Evden Eve Nakliyat
Sivas Parça Eşya Taşıma
Mersin Evden Eve Nakliyat
94BF2
ReplyDeleteBitlis Parça Eşya Taşıma
Kastamonu Parça Eşya Taşıma
Manisa Evden Eve Nakliyat
Karabük Parça Eşya Taşıma
Bayburt Parça Eşya Taşıma
18D79
ReplyDeleteAydın Evden Eve Nakliyat
Denizli Evden Eve Nakliyat
Bayburt Lojistik
Kocaeli Şehirler Arası Nakliyat
Karabük Evden Eve Nakliyat
Ünye Çekici
Altındağ Parke Ustası
Siirt Şehirler Arası Nakliyat
Probit Güvenilir mi
01413
ReplyDeleteAğrı Evden Eve Nakliyat
Bursa Parça Eşya Taşıma
Samsun Şehirler Arası Nakliyat
Muş Şehir İçi Nakliyat
Kırklareli Şehir İçi Nakliyat
İzmir Evden Eve Nakliyat
Manisa Şehirler Arası Nakliyat
Bitci Güvenilir mi
Edirne Şehirler Arası Nakliyat
D6946
ReplyDeleteArdahan Şehirler Arası Nakliyat
Batman Parça Eşya Taşıma
Ünye Oto Lastik
Ünye Parke Ustası
Karapürçek Parke Ustası
Etimesgut Parke Ustası
Bartın Şehirler Arası Nakliyat
Çerkezköy Çelik Kapı
Kırıkkale Parça Eşya Taşıma
2D097
ReplyDeleteKilis Parça Eşya Taşıma
Etimesgut Boya Ustası
Hatay Evden Eve Nakliyat
Kripto Para Borsaları
Adana Evden Eve Nakliyat
Niğde Evden Eve Nakliyat
Çerkezköy Marangoz
Niğde Parça Eşya Taşıma
Ünye Asma Tavan
229E7
ReplyDeleteAntalya Şehirler Arası Nakliyat
Aion Coin Hangi Borsada
Artvin Lojistik
Coin Nedir
Manisa Evden Eve Nakliyat
Kayseri Parça Eşya Taşıma
Silivri Cam Balkon
Meta Coin Hangi Borsada
Malatya Evden Eve Nakliyat
BF1B2
ReplyDeleteDüzce Şehir İçi Nakliyat
Uşak Şehirler Arası Nakliyat
Hatay Şehir İçi Nakliyat
Bitexen Güvenilir mi
Niğde Parça Eşya Taşıma
Bitci Güvenilir mi
Bingöl Lojistik
Erzincan Parça Eşya Taşıma
Meta Coin Hangi Borsada
3DA26
ReplyDeleteUrfa Şehir İçi Nakliyat
Ünye Fayans Ustası
Burdur Lojistik
Sonm Coin Hangi Borsada
Trabzon Şehir İçi Nakliyat
Ünye Çelik Kapı
Erzincan Şehir İçi Nakliyat
Yozgat Parça Eşya Taşıma
Aydın Şehir İçi Nakliyat
727F5
ReplyDeleteSinop Evden Eve Nakliyat
Kırıkkale Parça Eşya Taşıma
Çerkezköy Marangoz
Sinop Şehirler Arası Nakliyat
Giresun Parça Eşya Taşıma
Çerkezköy Çilingir
Çerkezköy Halı Yıkama
Kastamonu Evden Eve Nakliyat
Uşak Evden Eve Nakliyat
063B5
ReplyDeleteÜnye Organizasyon
Sakarya Evden Eve Nakliyat
Hatay Lojistik
Şırnak Lojistik
Silivri Parke Ustası
Hakkari Evden Eve Nakliyat
Kırklareli Şehir İçi Nakliyat
Tokat Şehir İçi Nakliyat
Bayburt Evden Eve Nakliyat
B4161
ReplyDeletebinance indirim
4D61A
ReplyDeletebinance komisyon indirimi
EAC12
ReplyDeleterize canlı sohbet odaları
Ankara Mobil Sohbet
Kocaeli Canli Sohbet
Kırklareli Parasız Sohbet Siteleri
Denizli Telefonda Canlı Sohbet
bartın görüntülü sohbet kızlarla
kırşehir canlı sohbet et
yalova ücretsiz sohbet siteleri
kızlarla rastgele sohbet
77A2B
ReplyDeleteücretsiz sohbet uygulaması
Balıkesir Canlı Ücretsiz Sohbet
karaman en iyi sesli sohbet uygulamaları
izmir sohbet chat
Bartın Canlı Görüntülü Sohbet
adana rastgele sohbet siteleri
rastgele sohbet
isparta canlı sohbet sitesi
Antalya Rastgele Görüntülü Sohbet Ücretsiz
151E0
ReplyDeletearbitrum
layerzero
galagames
shiba
looksrare
solflare
safepal
eigenlayer
ellipal
9FAFF
ReplyDeleteDenizli İftar Saatleri
Antalya İftar Saatleri
Mardin İftar Saatleri
Adana İftar Saatleri
Nevşehir İftar Saatleri
Kayseri İftar Saatleri
Isparta İftar Saatleri
Ankara İftar Saatleri
İzmir İftar Saatleri