You are not logged in.

#1 2017-04-07 15:10:54

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

[solved] Can't Seem to Add New Rules to iptables.

It's a while since I needed to edit iptables, but I can't seem to add new rules. The systemd iptables service is enabled and when I add a new rule and reload the unit, the new rule isn't added.

[root@vpn iptables]# iptables -nvL
Chain INPUT (policy ACCEPT 962 packets, 86707 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 834 packets, 126K bytes)
 pkts bytes target     prot opt in     out     source               destination
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
systemctl reload iptables

[root@vpn iptables]# iptables -nvL
Chain INPUT (policy ACCEPT 1047 packets, 93980 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 916 packets, 142K bytes)
 pkts bytes target     prot opt in     out     source               destination

Last edited by geekinthesticks (2017-04-07 17:01:14)

Offline

#2 2017-04-07 15:56:55

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [solved] Can't Seem to Add New Rules to iptables.

 iptables -t nat -nvL

pkgshackscfgblag

Offline

#3 2017-04-07 17:00:44

geekinthesticks
Member
From: England
Registered: 2011-09-21
Posts: 143
Website

Re: [solved] Can't Seem to Add New Rules to iptables.

Thanks! It does tell me in the man page, but I seem to remember that straightforward -nvL listed nat rules as well. My memory is obviously in need of a refresh.

Offline

#4 2017-04-07 17:54:25

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [solved] Can't Seem to Add New Rules to iptables.

Why use a cut-down view? Just use the standard:

iptables-save

Offline

Board footer

Powered by FluxBB