LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables: No chain/target/match by that name (https://www.linuxquestions.org/questions/linux-networking-3/iptables-no-chain-target-match-by-that-name-800914/)

secretlydead 04-08-2010 09:35 PM

iptables: No chain/target/match by that name
 
I'm not sure if I have a kernel problem or what here. My provider says it "should" work.

Since this doesn't give me any error:
Code:

root@a:/home/dan# echo 1 > /proc/sys/net/ipv4/ip_forward
root@a:/home/dan# iptables -P FORWARD ACCEPT

I think it should be basically configured properly.


However, I am getting these errors:
Code:

root@a:/home/dan# iptables --table nat -A POSTROUTING -o tun0 -j MASQUERADE -s 10.8.1.1/24
iptables: No chain/target/match by that name
root@a:/home/dan# iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE -s 10.8.1.1/24
iptables: No chain/target/match by that name


and ifconfig shows me:
Code:

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:10.8.1.1  P-t-P:10.8.1.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:1159 errors:0 dropped:0 overruns:0 frame:0
          TX packets:882 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:537223 (524.6 KiB)  TX bytes:79788 (77.9 KiB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:*.*.*.*  P-t-P:93.186.171.73  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

venet0:1  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:*.*.*.*  P-t-P:93.186.171.16  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1


Does this look like my problem or the problem with my server's kernel configuration (it's a vps)?

nimnull22 04-08-2010 10:28 PM

Can you post here output of command:
lsmod |grep ip

mweed 04-08-2010 10:42 PM

Taking a guess here. The modules should automagically be taken care of, but check lsmod and see if module ipt_MASQUERADE is loaded. If not run modprobe ipt_MASQUERADE and try again.

Also is your ip address (the one being NATed to) static? If so try the SNAT target instead of MASQUERADE.


All times are GMT -5. The time now is 02:16 AM.