Sponsored Content
Full Discussion: iptables changes
Special Forums IP Networking iptables changes Post 302385319 by rina5392 on Thursday 7th of January 2010 07:49:22 PM
Old 01-07-2010
iptables changes

Hello

We have one linux machine in the office which happens to be an important firewall. I just know the basics and need to make one change

Essentially it is forward mysql traffic to another internal machine.

This is the original rule (forward to 192.20.0.17) which is working


Code:
$IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 3306 -j allowed
$IPTABLES -t nat -A PREROUTING -p TCP -i $INET_IFACE -d $STATIC_IP --dport 3306 -j DNAT --to-destination 192.20.0.17
$IPTABLES -A FORWARD -p tcp -i $INET_IFACE -o $LAN_IFACE -d 192.20.0.17 --dport 3306 -j allowed


and i just need to send it to 192.20.0.15 so i just change -->

Code:
$IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 3306 -j allowed
$IPTABLES -t nat -A PREROUTING -p TCP -i $INET_IFACE -d $STATIC_IP --dport 3306 -j DNAT --to-destination 192.20.0.15
$IPTABLES -A FORWARD -p tcp -i $INET_IFACE -o $LAN_IFACE -d 192.20.0.15 --dport 3306 -j allowed

and restart the machine.

But this does not work. is there anything else that must be done ?

The 192.20.0.15 mysql is working as i can get telnet response from it.

Any assistance will be appreciated

Last edited by pludi; 01-08-2010 at 02:20 AM.. Reason: code tags, please...
 

10 More Discussions You Might Find Interesting

1. IP Networking

IPtables

Hey guys, I have just started using IP tables and was wondering if anyone could direct me to any good online resources as I am totally new to this. Thanks. (1 Reply)
Discussion started by: 182x
1 Replies

2. IP Networking

Need help with iptables

Trying to create a whitelist to limit bandwidth. My sync speed is 1536/256 kbps. Simple rules in order: 1. Do not limit (or set to 1536/256) MAC 00:00:00:00:00 (computer is in 192.168.1.0/24). 2. Do not limit (or set to 1536/256) MAC 00:00:00:00:01 (computer is in 192.168.1.0/24). 3. Do not... (1 Reply)
Discussion started by: kripz
1 Replies

3. IP Networking

Iptables

Thanks in advance I have to remove ip_tables_name from /proc/net/... i was trying to do so and getting the following error cmd : rm ip_tables_names error : rm: remove regular empty file `ip_tables_names'? y rm: cannot remove `ip_tables_names': Operation not permitted (4 Replies)
Discussion started by: sudeepiit
4 Replies

4. IP Networking

iptables assistance

I have a CentOS 5.2 (10.20.21.73) machine that I need help with configuring iptables. According to documentation I believe this line should allow all communication between my machine and another machine (other machine has no firewall) -A RH-Firewall-1-INPUT -s 10.20.21.12 -j ACCEPT #... (1 Reply)
Discussion started by: beaker457
1 Replies

5. IP Networking

Iptables

What should be the iptables rule so that only the subnet 64.61.11.224/255.255.255.248 may access the mysql port 3306 (1 Reply)
Discussion started by: proactiveaditya
1 Replies

6. UNIX for Dummies Questions & Answers

help with iptables

Hi, On the IPTABLES, I did iptables --flush. I want to start fresh. Now I only want two things. Allow one ip address to this server. Allow port 443 as incoming from every where. Please advice how to do this. This is what I did so for. iptables -I INPUT -i eth0 -s 1.2.3.4 -j ACCEPT... (5 Replies)
Discussion started by: samnyc
5 Replies

7. UNIX for Dummies Questions & Answers

Help with iptables

Hi, I just build a Linux server, I said yes to enable the firewall. I only choose SSH conneciton. When I check the iptables. I see all of this (see below). I want to reject every thing only allow SSH from subnet 192.168.1.xx. Can you advise, how to do. Chain RH-Firewall-1-INPUT (2... (2 Replies)
Discussion started by: samnyc
2 Replies

8. IP Networking

Help with iptables

photo... (1 Reply)
Discussion started by: beerpong1
1 Replies

9. Red Hat

iptables help for port 80

Hi I enable the IPtables but port 80 was not working. Below is my active configuration (10 Replies)
Discussion started by: ranjancom2000
10 Replies

10. Ubuntu

iptables

Hi I need help with an iptables configuration, this is what I have server A Server B A and B are using different gateways i am sending port 22 from A to B, I see the packages coming in B but B is not sending the package to internet. please give me some examples. (0 Replies)
Discussion started by: lmartinez073
0 Replies
PACKET.PKT(1)							 packet.pkt 1.0.1						     PACKET.PKT(1)

NAME
packet.pkt - Pkt module DESCRIPTION
Provides the object for a packet and the string representation of the packet. This object has an attribute for each of the layers in the packet so each layer can be accessed directly instead of going through each layer. To access the nfs layer object you can use 'x.nfs' instead of using 'x.ethernet.ip.tcp.rpc.nfs' which would very cumbersome to use. Also, since NFS can be used with either TCP or UDP it would be harder to to access the nfs object independently or the protocol. Packet object attributes: Pkt( record = Record information (frame number, etc.) ethernet = ETHERNET II (RFC 894) object ip = IPv4 object tcp = TCP object rpc = RPC object nfs = NFS object ) CLASSES
class Pkt(baseobj.BaseObj) Packet object Usage: from packet.pkt import Pkt x = Pkt() Methods defined here: --------------------- __str__(self) String representation of object The representation depends on the verbose level set by debug_repr(). If set to 0 the generic object representation is returned. If set to 1 the representation of is condensed into a single line. It contains, the frame number, IP source and destination and/or the last layer: '1 0.386615 192.168.0.62 -> 192.168.0.17 TCP 2049 -> 708, seq: 3395733180, ack: 3294169773, ACK,SYN' '5 0.530957 00:0c:29:54:09:ef -> ff:ff:ff:ff:ff:ff, type: 0x806' '19 0.434370 192.168.0.17 -> 192.168.0.62 NFS v4 COMPOUND4 call SEQUENCE;PUTFH;GETATTR' If set to 2 the representation of the object is a line for each layer: 'Pkt( RECORD: frame 19 @ 0.434370 secs, 238 bytes on wire, 238 bytes captured ETHERNET: 00:0c:29:54:09:ef -> e4:ce:8f:58:9f:f4, type: 0x800(IPv4) IP: 192.168.0.17 -> 192.168.0.62, protocol: 6(TCP), len: 224 TCP: src port 708 -> dst port 2049, seq: 3294170673, ack: 3395734137, len: 172, flags: ACK,PSH RPC: CALL(0), program: 100003, version: 4, procedure: 1, xid: 0x1437d3d5 NFS: COMPOUND4args(tag='', minorversion=1, argarray=[nfs_argop4(argop=OP_SEQUENCE, ...), ...]) )' SEE ALSO
baseobj(1) BUGS
No known bugs. AUTHOR
Jorge Mora (mora@netapp.com) NFStest 1.0.2 10 April 2013 PACKET.PKT(1)
All times are GMT -4. The time now is 08:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy