Example:
Ip ubuntu to the modem (eth0): 192.168.1.3/24
Gateway (ip modem): 192.168.1.1
IP ubuntu to lan (eth1): 192.168.2.1/24
Ip ubuntu to the modem (eth0): 192.168.1.3/24
Gateway (ip modem): 192.168.1.1
IP ubuntu to lan (eth1): 192.168.2.1/24
There are several steps :
=====================
=====================
1. Provide IP on eth0 and eth1
pico /etc/network/interfaces
=====================
pico /etc/network/interfaces
=====================
Save the configuration and exit, then restart using the command :
/etc/init.d/networking restart
===========================================
==========================
2. IP Forwarding settings and iptables
pico /etc/rc.local
==========================
pico /etc/rc.local
==========================
Add the following rules before "exit 0" :
echo 1 > /proc/sys/net/ipv4/ip_forward
Add the following rules :
iptables –t nat –A POSTROUTING –j MASQUERADE
If using squid / lusca as a proxy, add the following rule (adjust the port configuration in your squid.conf) :
iptables –t nat –A PREROUTING –p tcp --dport 80 –j REDIRECT --to-port 3128
If a proxy is used to support https ssl bump for the cache, add the following rule (adjust the port configuration in your squid.conf) :
iptables –t nat –A PREROUTING –p tcp --dport 443 –j REDIRECT --to-port 3127
Then save the changes.
rc.local is enabled by typing the command :
/etc/init.d/rc.local start
echo 1 > /proc/sys/net/ipv4/ip_forward
Add the following rules :
iptables –t nat –A POSTROUTING –j MASQUERADE
If using squid / lusca as a proxy, add the following rule (adjust the port configuration in your squid.conf) :
iptables –t nat –A PREROUTING –p tcp --dport 80 –j REDIRECT --to-port 3128
If a proxy is used to support https ssl bump for the cache, add the following rule (adjust the port configuration in your squid.conf) :
iptables –t nat –A PREROUTING –p tcp --dport 443 –j REDIRECT --to-port 3127
Then save the changes.
rc.local is enabled by typing the command :
/etc/init.d/rc.local start
==============
pico /etc/sysctl.conf
==============
==============
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
net.ipv4.ip_forward=1
sysctl -p
When the report :
net.ipv4.ip_forward=1
=============
3. Testing on client
=============
IP settings on one client with the following configuration:
ip : 192.168.2.2
netmask : 255.255.255.0
gateway : 192.168.2.1
DNS : 8.8.8.8 8.8.4.4
ping test on cmd
ping 8.8.8.8
If it is currently in a ping reply, then the gateway setting is ok.
If not? ask in the forums or friends who know better :)
May be implemented on the router as a client of a proxy server gateway ubuntu
INFO SERVICE PROXY SETTING AND MIKROTIK
089693433305 / fathayu@gmail.com / fathayu@yahoo.co.id





Tidak ada komentar:
Posting Komentar