Difference between revisions of "Bridge Firewall Linux"

From MS Computech
Jump to: navigation, search
 
Line 3: Line 3:
 
ผมใช้วิธีนี้ติดตั้งบน Debian 7 8 9   
 
ผมใช้วิธีนี้ติดตั้งบน Debian 7 8 9   
 
<pre># apt-get install bridge-utils</pre>
 
<pre># apt-get install bridge-utils</pre>
&nbsp;นำConfig ทั้งหมดไส่ใน&nbsp;'''/etc/rc.local'''
+
Edit Config ใน&nbsp;'''/etc/rc.local'''
 
<pre>
 
<pre>
 
nano /etc/rc.local
 
nano /etc/rc.local

Latest revision as of 19:27, 16 March 2019

Bridge Firewall Linux

ผมใช้วิธีนี้ติดตั้งบน Debian 7 8 9 

# apt-get install bridge-utils

Edit Config ใน /etc/rc.local

nano /etc/rc.local
# Bridge Interface

ifconfig eth0 down
ifconfig eth1 down
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
brctl stp br0 on
ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up
ifconfig br0 192.168.1.107 netmask 255.255.255.0 up
route add default gw 192.168.1.1

Enable kernel 4.9 bridge filter หากไม่ทำการโหลดโมดูล Bridge จะเป็นแค่ Layer 2 Switch ไม่สามารถ Filter ข้อมูลได้

modprobe br_netfilter
depmod -a
echo 1 > /proc/sys/net/ipv4/ip_forward