Configure the shorewall firewall in Ubuntu

Source: Internet
Author: User
In the network environment, one Ubuntu server has three NICs, eth0 and eth1 are connected to adsl for different Intranet segments, and PPPOE is used for dialing. # Pwd code:/etc/shorewall # catinterfaces code: netppp0detectloc1eth

In the network environment, one Ubuntu server has three NICs, eth0 and eth1 are connected to adsl for different Intranet segments, and PPPOE is used for dialing.

# Pwd
Code:
/Etc/shorewall


# Cat interfaces
Code:
Net ppp0 detect
Loc1 eth0 detect dhcp
Loc2 eth1 detect dhcp
 


# Cat masq
Code:
Eth0 eth1
Ppp0 eth0
Ppp0 eth1
 


# Cat modules
Code:
Loadmodule ip_tables
Loadmodule iptable_filter
Loadmodule ip_conntrack
Loadmodule ip_conntrack_ftp
Loadmodule ip_conntrack_tftp
Loadmodule ip_conntrack_irc
Loadmodule iptable_nat
Loadmodule ip_nat_ftp
Loadmodule ip_nat_tftp
Loadmodule ip_nat_irc
Loadmodule ip_conntrack_proto_gre
Loadmodule ip_conntrack_pptp
Loadmodule ip_nat_pptp
Loadmodule ip_nat_proto_gre
 


# Cat policy
Code:
Loc1 fw ACCEPT
Loc2 fw ACCEPT
Fw all ACCEPT
Net all DROP info
All REJECT info


# Cat zones
Code:
Net Internet 0.0.0.0/24
Loc2 Local 192.168.2.0/24
Loc1 Local 192.168.1.0/24


# Cat rules
Code:
# TarGET source dest proto dest source rate user/
# PORT (S) LIMIT GROUP
AllowDNS all net
AllowSMTP loc1 net
AllowSMTP loc2 net
AllowIMAP loc1 net
AllowIMAP loc2 net
AllowPOP3 loc1 net
AllowPOP3 loc2 net
AllowFTP all fw
AllowPing all fw
AllowSMB loc1 fw
AllowSMB loc2 fw
AllowSSH all fw
AllowSSH loc1 fw
AllowSVN loc1 fw
AllowSVN loc2 fw
AllowWeb all fw
AllowVNC all
AllowVNCL all
AllowBitTorrent all
AllowCVS loc1 net

ACCEPT loc1 loc2: 192.168.2.3 all
ACCEPT loc1 loc2: 192.168.2.6 all

# Admin
ACCEPT loc1 :~ 00-50-BA-69-A3-6D all

# UC
ACCEPT all fw tcp 3001
ACCEPT all net tcp 3001

# Msn
ACCEPT all net tcp 1863
ACCEPT all net tcp 443
ACCEPT all net: 65.54.239.211 all
ACCEPT all net udp 9
ACCEPT all net udp 7001

# Mq
ACCEPT loc1 net tcp 1401
ACCEPT loc1 net tcp 1402
ACCEPT loc1 net tcp 1403
ACCEPT loc1 net tcp 1412
ACCEPT loc2 net tcp 1401
ACCEPT loc2 net tcp 1402
ACCEPT loc2 net tcp 1403
ACCEPT loc2 net tcp 1412

# EMule
ACCEPT net fw tcp 4661: 4672
ACCEPT net fw tcp 4661: 4672

# VPN
ACCEPT all net tcp 1723
ACCEPT all net 47-

# Web
REDIRECT loc1 3128 tcp www -! 192.168.1.0
REDIRECT loc2 3128 tcp www -! 192.168.2.0

# Bt
ACCEPT net fw tcp 6551
ACCEPT net fw udp 6551
DNAT all loc1: 192.168.1.2 tcp 6551
DNAT all loc1: 192.168.1.2 udp 6551

# Remote Desktop
ACCEPT net fw tcp 3389
DNAT all loc1: 192.168.1.8 tcp 3389

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.