SnapGear 1.7.8 manual Forward

Page 102

iptables -I INPUT -j LOG -p tcp --syn -s <X.X.X.X/XX> -d <Y.Y.Y.Y/YY> --dport <Z> --log-prefix <prefix>

This will log any TCP (-p tcp) session initiations (--syn) that arrive from the IP address/netmask X.X.X.X/XX (-s ...) and are going to Y.Y.Y.Y/YY, destination port Z (-- dport).

For example, to log all inbound access requests from anywhere on the Internet (0.0.0.0/0) to the PPTP service (port 1723) on the SnapGear appliance (IP address 1.2.3.4):

iptables -I INPUT -j LOG -p tcp --syn -s 0.0.0.0/0 -d 1.2.3.4 --dport 1723 --log-prefix "Internet PPTP access: "

To find the resultant log entry in the logs, simply search for the prefix, in this instance "Internet PPTP access: ".

If for example site 192.0.1.2 attempted to access the SnapGear appliance’s PPTP port, the resultant log message would look something like this:

<12> Jan 24 17:19:17 2000 klogd: Internet PPTP access: IN=eth0 OUT= MAC=00:d0:cf:00:07:03:00:50:bf:20:66:4d:08:00 SRC= DST=1.2.3.4 LEN=48 TOS=0x00 PREC=0x00 TTL=127 ID=43470 DF PROTO=TCP SPT=4508 DPT=1723 WINDOW=64240 RES=0x00 SYN URGP=0

Note how OUT is set to nothing. This indicates that the packet was attempting to reach a service on the SnapGear appliance, rather than attempting to pass through it.

A very similar scenario occurs for logging access requests that are attempting to pass through the SnapGear appliance. It merely requires replacing the INPUT keyword with

FORWARD.

Thus, to log permitted inbound requests to services hosted on a server behind the SnapGear appliance, or outbound requests to services on a public network server, use:

iptables -I FORWARD -j LOG -p tcp --syn -s <X.X.X.X/XX> -d <Y.Y.Y.Y/YY> --dport <Z> --log-prefix <prefix>

For example, to log all inbound requests from the IP address 5.6.7.8 to the mail server (port 25) on the machine flubber on the LAN with address 192.168.1.1:

99

Appendix B – System Log

Image 102
Contents Rev May 2nd Table of contents Virtual Private Networking Introduction Terminology Term MeaningLAN Document conventions TCP/IPInstalling and configuring your SnapGear appliance Step ChapterYour SnapGear appliance LEDsLabel Activity Description SnapGear appliance back panels Network interconnections SnapGear appliance features Software featuresInternet link features LAN link featuresDial-in connection features Environmental features Static IP reset Getting startedNew Networks 10.0.0.0 10.255.255.255 10/8 prefix192.168.0.0 192.168.0.255 192.168.0/24 prefix Configuring the SnapGear appliance on your network Page Set up IP addresses Your SnapGear appliance was found on the network Multiple SnapGear appliances were found on the networkYour SnapGear appliance needs an IP address Administrative password SnapGear Management Console web administration pagesInitial setup using Linux Using linsetipUsing an existing local Dhcp or Bootp server Ping -b subnet broadcast address Arp -aConfiguring a new local Dhcp or Bootp server Edit the /etc/inetd.conf fileSnapGear Quick Setup LAN port quick setup LAN port quick setupISP connection quick setup ISP connection quick setupGetting started Configuring the PCs on your network TCP/IP properties Connecting to the Internet Physically connect modem deviceSelect Internet connection Connect to Internet cable modemConnect to Internet Adsl Connect to Internet direct Connect to Internet modemISP. The Password and Confirm Password fields must Field DescriptionAdvanced configuration option Internet failoverFollowing figure shows the failover configuration screen Failed connection Configure PCs to use SnapGear appliance Internet gateway Establishing the connectionDial-in server configuration Dial-in server configuration Dial-in setup Dial-in setupField Description Dial-in user accounts Dial-in user account creationFollowing figure shows the user maintenance screen Dial-in password error Account listRemote user configuration For Windows 95 and WindowsServer types Windows Connect to dialogue boxClick Next to continue 11 Connection availability 13 Remote access login screen Network configuration IP configurationNetwork configuration Advanced IP configuration Advanced IP configurationNetwork configuration Dhcp server configuration Dhcp serverNetwork configuration Advanced networking Traffic shapingAdditional routes Incoming access FirewallIncoming access administration services Incoming access configurationExternal access to services Configure external access to servicesPort forwarding configuration Port forwardingOutgoing access Security group classes configurationOutgoing access settings Firewall rulesIntrusion detection and blocking configuration Intrusion detection and blockingPage Content filtering Content filtering Filtering levels and reporting Filtering Level Description1VPN tunneling using the Pptp server Virtual Private NetworkingPptp client setup Pptp client configuration Pptp server setup Enable and configure the Pptp VPN server Pptp server setupField Description Configuring user accounts for VPN server 4PPTP VPN server accounts screenVirtual Private Networking Configuring the remote VPN client VPN Pptp IP addressVirtual Private Networking VPN client setup Windows 95 and WindowsYour VPN client is now set up correctly Windows NT Network and dial-up connections This displays the Destination Address window Connecting the remote VPN client IPSec setup 12 IPSec setup13 Add new IPSec connection Virtual Private Networking 14 Automatic keying setup Aggressive mode phase 1 settings Technique DescriptionIPSec interoperability Password SystemTime server Diagnostics AdvancedFlash upgrade Reset buttonTechnical support Technical supportAppendix a LED status patterns LED Pattern Status ActionAccess Logging Appendix B System LogEth1 Default DenyEth0 PppCreating Custom Log Rules Forward Iptables -I Forward -j LOG -i eth+ -o eth+ -p tcp Administrative Access Logging Rate LimitingBoot Log Messages