自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Ubuntu Linux系統(tǒng)下設(shè)置shorewall防火墻

安全
服務(wù)器采用Ubuntu作為操作系統(tǒng),兩塊網(wǎng)卡,一塊接外網(wǎng)(eth0),一塊接內(nèi)網(wǎng)(eth1)。采用shorewall作為防火墻。

服務(wù)器采用Ubuntu作為操作系統(tǒng),兩塊網(wǎng)卡,一塊接外網(wǎng)(eth0),一塊接內(nèi)網(wǎng)(eth1)。采用shorewall作為防火墻。

配置網(wǎng)卡:

sudo vi /etc/network/interfaces

Ubuntu下設(shè)置shorewall防火墻

服務(wù)器采用Ubuntu作為操作系統(tǒng),兩塊網(wǎng)卡,一塊接外網(wǎng)(eth0),一塊接內(nèi)網(wǎng)(eth1)。采用shorewall作為防火墻。

配置網(wǎng)卡:

sudo vi /etc/network/interfaces
------------------------------------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0

# The primary network interface
iface eth0 inet static
address 192.168.2.250
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.96.209.6

auto eth1
iface eth1 inet static
address 192.168.10.254
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

1、安裝shorewall

sudo apt-get install shorewall

2、拷貝配置文件

sudo cp /usr/share/shorewall/modules /etc/shorewall

sudo cp /usr/share/doc/shorewall/default-config/policy /etc/shorewall/

sudo cp /usr/share/doc/shorewall/default-config/nat /etc/shorewall/

sudo cp /usr/share/doc/shorewall/default-config/zones /etc/shorewall/

sudo cp /usr/share/doc/shorewall/default-config/maclist /etc/shorewall/

sudo cp /usr/share/doc/shorewall/default-config/blacklist /etc/shorewall/

sudo cp /usr/share/doc/shorewall/default-config/interfaces /etc/shorewall/interfaces

sudo cp /usr/share/doc/shorewall/default-config/rules /etc/shorewall/rules

sudo cp /usr/share/doc/shorewall/default-config/hosts /etc/shorewall/hosts

sudo cp /usr/share/doc/shorewall/default-config/masq /etc/shorewall/masq

3、配置網(wǎng)卡

sudo vi /etc/shorewall/interfaces

在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行之后加上:

net eth0 detect

loc eth1 detect

4、配置網(wǎng)絡(luò)別名

sudo vi /etc/shorewall/zones

在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行之后加上:

net Net Internet

loc Local Local Networks

5、配置IP偽裝,也就是透明代理

sudo vi /etc/shorewall/masq

在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行之后加上:

eth0 eth1

6、配置策略

sudo vi /etc/shorewall/policy

在#LAST LINE -- DO NOT REMOVE這一行最后加上:

loc net ACCEPT

net all DROP info

all all REJECT info

7、配置防火墻規(guī)則

sudo vi /etc/shorewall/rules

在倒數(shù)第二行,也就是在 “#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE” 這一行后加上:

#incoming traffic (由 internet 去 firewall)

AllowSSH net fw

AllowDNS net fw

AllowWeb net fw

AllowSMB net fw

AllowNNTP net fw

AllowNTP net fw

AllowRdate net fw

AllowSMTP net fw

DropPing net fw

 

#outgoing traffic (由 firewall 去 internet)

AllowWeb fw net

AllowDNS fw net

AllowSMTP fw net

AllowSMB fw net

AllowSMTP fw net

AllowNNTP fw net

AllowNTP fw net

AllowRdate fw net

AllowSSH fw net

#open special ports

ACCEPT net fw tcp 9980

8、修改 shorewall.conf 自動(dòng)開(kāi)啟 IP 轉(zhuǎn)發(fā)

sudo gedit /etc/shorewall/shorewall.conf

查找到:

IP_FORWARDING=Keep

修改為:

IP_FORWARDING=On

# 保存關(guān)閉文件

9、修改 /etc/default/shorewall 自動(dòng)運(yùn)行防火墻

sudo vi /etc/default/shorewall

查找到:

startup=0

修改為:

startup=1

10、啟動(dòng)防火墻

sudo shorewall start

11、至此防火墻配置完成。

責(zé)任編輯:Oo小孩兒 來(lái)源: linuxeden.com
相關(guān)推薦

2009-12-02 18:54:28

2011-03-17 16:00:57

2009-02-22 09:30:24

2009-10-12 12:51:50

Linux作系統(tǒng)防火墻

2010-09-13 17:45:37

2010-03-05 09:36:04

linux系統(tǒng)防火墻

2011-03-15 17:25:38

2018-02-06 10:53:53

2011-03-15 16:35:27

2020-04-07 13:20:52

Linux防火墻ufw

2009-09-28 10:06:09

Linux防火墻Linux規(guī)則

2017-08-29 16:04:13

Linux命令防火墻設(shè)置

2022-01-06 07:59:05

Linux 防火墻進(jìn)程

2010-03-31 17:43:44

CentOS防火墻

2009-12-08 17:37:49

Windows 7防火

2011-03-16 10:17:06

2009-12-23 17:37:09

Linux防火墻

2010-03-08 09:09:48

2011-03-17 10:58:55

Linux防火墻Iptables入門(mén)

2009-07-03 11:14:57

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)