Difference between revisions of "Bridge Firewall Linux"

From MS Computech
Jump to: navigation, search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Bridge Firewall Linux  
 
Bridge Firewall Linux  
  
I'm use this install on debian etch
+
ผมใช้วิธีนี้ติดตั้งบน Debian 7 8 9 
 +
<pre># apt-get install bridge-utils</pre>
 +
Edit Config ใน&nbsp;'''/etc/rc.local'''
 +
<pre>
 +
nano /etc/rc.local
 +
</pre>
 +
<pre>
 +
# Bridge Interface
  
&nbsp;
+
ifconfig eth0 down
<pre># yum -y install bridge-utils
+
ifconfig eth1 down
# yum -y install ebtables
+
brctl addbr br0
# brctl addbr br0
+
brctl addif br0 eth0
# brctl addif br0 eth0
+
brctl addif br0 eth1
# brctl addif br0 eth1
+
brctl stp br0 on
# brctl stp br0 on
+
ifconfig eth0 0.0.0.0 up
# ifconfig eth0 0.0.0.0 up
+
ifconfig eth1 0.0.0.0 up
# ifconfig eth1 0.0.0.0 up
+
ifconfig br0 192.168.1.107 netmask 255.255.255.0 up
# ifconfig br0 1.1.1.1 netmask 255.0.0.0 up
+
route add default gw 192.168.1.1
# route add default gw 1.1.1.1</pre>
+
</pre>
&nbsp;Put all&nbsp;above&nbsp;config in /etc/rc.local
 
  
&nbsp;install vuurmuur
+
Enable kernel 4.9 bridge filter หากไม่ทำการโหลดโมดูล Bridge จะเป็นแค่ Layer 2 Switch ไม่สามารถ Filter ข้อมูลได้
 
+
<pre>
Editfiles /etc/sysconfig/network-script/ifcfg-eth0,ifcfg-eth1<br>
+
modprobe br_netfilter
<pre># nano /etc/sysconfig/network-script/ifcfg-eth0,ifcfg-eth1
+
depmod -a
DEVICE=eth0
+
echo 1 > /proc/sys/net/ipv4/ip_forward
ONBOOT=yes
+
</pre>
HWADDR=00:00:00:00:00
 
TYPE=Ethernet
 
#BOOTPROTO=dhcp &lt;&lt;&lt;------- unmark this </pre>
 

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