No Image

iptables port redirection

2015-12-29 KENNETH 1

iptables 를 이용한 포트 리다이렉션   원하는 내용 OS : linux 기본 smtp 포트는 25번을 사용하되, 587에서의 접근을 허용하고자 함 다만, 메일엔진에서 설정하지 않고 리눅스의 iptables만을 가지고 처리 하고 싶다면…   설정 echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING -p tcp –dport 587 -j REDIRECT –to-port 25 기존에 작동하는 25번 포트는 변동 사항이 없으며 추가로 587 포트에 대해서 접근을 요청시 25포트로 리다이렉션 해줌   테스트 사용툴 : terminal & telnet # telnet 192.168.0.111 587 Trying 192.168.0.111… Connected to 192.168.0.111. Escape character is ‘^]’. 220 office.ilaya.com ESMTP Sendmail 8.14.7/8.14.7; Tue, 29 Dec 2015 11:39:37 +0900

No Image

telnet 을 이용한 smtp 릴레이(relay) 테스트

2015-04-30 KENNETH 0

1. 발송과정 (노란색 표시가 실제입력) root@ns1:~ 14:37:17 # telnet localhost 25 Trying 127.0.0.1… Connected to localhost.localdomain (127.0.0.1). Escape character is ‘^]’. 220 ns1.greatuser.net ESMTP ehlo 250-ns1.greatuser.net 250-STARTTLS 250-AUTH LOGIN CRAM-MD5 PLAIN 250-AUTH=LOGIN CRAM-MD5 PLAIN 250-PIPELINING 250 8BITMIME mail from: [email protected] 250 ok rcpt to: [email protected] 250 ok data 354 go ahead From: [email protected] To: [email protected] Subject: This is mail test on telnet kekekeke hahahaha -_-;;;;;; . 250 ok 1259473124 qp 21929 quit 221 ns1.greatuser.net Connection closed by foreign host.   2. 발송후 수신된 메세지원본 Return-Path: <[email protected]> Delivered-To: [email protected] Received: (qmail 19348 invoked by uid 1001); 29 Nov 2009 14:38:43 +0900 Hanbiro-rcptto: [email protected]| Hanbiro-remoteip: 210.100.100.XXX Received: from unknown (HELO ns1.greatuser.net) (210.100.100.XXX) by 0 (qmail 1.03 + ejcp v14) with AES256-SHA encrypted SMTP; 29 Nov 2009 14:38:43 +0900 Received-SPF: pass (0: SPF record at greatuser.net designates 210.100.100.XXX as permitted sender) Received: (qmail [ more… ]