Forwarding: Our PC act as a gateway

Forwarding memungkinkan paket-paket data dari NIC (network interface) satu (misalnya eth0) diforward ke network interface yang lain (misal eth1)
Langkah pertama:

[root@csmwin etc]# echo 1 > /proc/sys/net/ipv4/ip_forward

Atau masukkan di /etc/rc.local –> untuk membuat “permanent”

Cek:

[root@csmwin etc]# cat /proc/sys/net/ipv4/ip_forward
1

Metode lainnya:

[root@csmwin etc]# vi /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 0 —–> ganti 0 menjadi 1

Langkah kedua:

[root@csmwin etc]# vi /etc/sysconfig/network

Tambahkan baris berikut:

FORWARD_IPV4=true

Langkah berikutnya:

[root@csmwin csmwin]# /sbin/iptables –table nat –flush
[root@csmwin csmwin]# /sbin/iptables -A POSTROUTING -j MASQUERADE -t nat -s 192.168.0.0/24 -o eth0
Sharing ilmu ini terselenggara atas kerjasama dengan mas agus, seorang admin dan pemilik sebuah hosting di semarang

1 thought on “Forwarding: Our PC act as a gateway”

  1. What i do not realize is actually how you are now not actually much more smartly-favored than you might be now.
    You’re very intelligent. You already know therefore considerably in the
    case of this topic, produced me individually believe it from so many numerous angles.
    Its like women and men aren’t fascinated until it’s
    one thing to accomplish with Woman gaga!
    Your individual stuffs outstanding. At all times take care of
    it up!

Leave a Reply

Your email address will not be published. Required fields are marked *