sed and comma-delimited file
Yo; I have a series of comma-delimited text files with fourteen columns of data and several hundred rows. I want to use a short shell script to strip them of the last 9 columns, leaving the same file but with just five of its columns. I can do it in C++, but that seems like overkill. How would I go about doing it with sed or a similar utility? SigmaX ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
IPFW rules
I'm trying to setup IPFW to block all ports except those I specify. For starters I'm just opening SSH. # ipfw list 00050 divert 8668 ip4 from any to any via rl0 00100 allow ip from any to any via lo0 00200 deny ip from any to 127.0.0.0/8 00300 deny ip from 127.0.0.0/8 to any 00301 allow log tcp from any to any dst-port 22 00399 deny ip from any to any 65000 allow ip from any to any 65535 deny ip from any to any Traffic is still blocked on port 22 -- I can't login via SSH. What am I doing wrong, and what rule should I be using to allow SSH in and through? SigmaX ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Gateway [SOLVED]
For the archives: Found my problem. Te firewall_type option is case sensitive -- and OPEN is supposed to be lowercase. Cheerio, SigmaX On 7/28/06, SigmaX asdf [EMAIL PROTECTED] wrote: I'm trying to setup a gateway/firewall on my network in a similar setup to that shown in the in the handbook diagram at http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-natd.html . I've followed what I can figure out, adding the following to my /etc/rc.conf gateway_enable=YES firewall_enable=YES firewall_type=OPEN natd_enabl=YES natd_interface=rl0 My understanding is that in FreeBSD 6 it's not necessary to recompile a kernal with IPFIREWALL and IPDIVERT, but appropriate modules will be loaded automatically. That said, the NAT and gateway stuff doesn't seem to be working properly, leastwise not when I try to connect from my Ubuntu Linux client (See thread here: http://ubuntuforums.org/showthread.php?t=224843) What all am I supposed to do to setup this gateway? SigmaX ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Port forwarding with IPFW/NATD
I've setup a firewall box with IPFW and NATD with what the handbook had to offer on the subject, and now would like to get traffic forwarded to behind my shmancy new firewall. Google is purely confusing me on this one. From what I understand I need to do one or more of the following: setup a divert rule for ipfw setup a fwd rule for ipfw setup a redirect_port rule for natd compile forwarding support into my kernel Somehow I doubt it's all of the above. What am I supposed to do to allow port forwarding? Thanx for any pointers, SigmaX # ipfw list 00010 divert 8668 tcp from any to 10.0.0.2 dst-port 80 00050 divert 8668 ip4 from any to any via rl0 00100 allow ip from any to any via lo0 00200 deny ip from any to 127.0.0.0/8 00300 deny ip from 127.0.0.0/8 to any 65000 allow ip from any to any 65535 deny ip from any to any Semi-relevant rc.conf options: gateway_enable=YES firewall_enable=YES firewall_type=open natd_enable=YES natd_interface=rl0 natd_flags=-dynamic -m -f /etc/natd.conf ipfw_enable=YES natd.conf: redirect_port tcp 10.0.0.2:80 80 ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Port forwarding with IPFW/NATD [SOLVED]
Spoke too soon; figured it out not a minute later. It seems to work if I remove the divert rule for my server (10.0.0.2) from ipfw, and leave the natd parameter. SigmaX On 8/20/06, SigmaX asdf [EMAIL PROTECTED] wrote: I've setup a firewall box with IPFW and NATD with what the handbook had to offer on the subject, and now would like to get traffic forwarded to behind my shmancy new firewall. Google is purely confusing me on this one. From what I understand I need to do one or more of the following: setup a divert rule for ipfw setup a fwd rule for ipfw setup a redirect_port rule for natd compile forwarding support into my kernel Somehow I doubt it's all of the above. What am I supposed to do to allow port forwarding? Thanx for any pointers, SigmaX # ipfw list 00010 divert 8668 tcp from any to 10.0.0.2 dst-port 80 00050 divert 8668 ip4 from any to any via rl0 00100 allow ip from any to any via lo0 00200 deny ip from any to 127.0.0.0/8 00300 deny ip from 127.0.0.0/8 to any 65000 allow ip from any to any 65535 deny ip from any to any Semi-relevant rc.conf options: gateway_enable=YES firewall_enable=YES firewall_type=open natd_enable=YES natd_interface=rl0 natd_flags=-dynamic -m -f /etc/natd.conf ipfw_enable=YES natd.conf: redirect_port tcp 10.0.0.2:80 80 ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Gateway
I take it firewall_type=OPEN does not include the divert rule? The handbooks reads The kernel source needs 'option divert' statement added to the other IPFIREWALL statements compiled into a custom kernel. Is this still the case in FreeBSD 6.1? Or am I covered by the IPDIVERT module or something? SigmaX On 7/29/06, Igor Robul [EMAIL PROTECTED] wrote: On Sat, Jul 29, 2006 at 01:42:41PM -0400, SigmaX asdf wrote: ^^^ Should be natd_enable=YES Heh; yeah, typo in my post. The file has it ok. Is there something I have to do to specify the interfaces which have nat enabled? Does natd_enable automatically forward any/every packet to any/every interface? Personally I use ipfilter, but for ipfw/natd you need to specify divert rule. You can find many examples, including ones in FreeBSD handbook. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Gateway
On 7/29/06, Igor Robul [EMAIL PROTECTED] wrote: On Fri, Jul 28, 2006 at 07:00:18PM -0400, SigmaX asdf wrote: gateway_enable=YES firewall_enable=YES firewall_type=OPEN natd_enabl=YES ^^^ Should be natd_enable=YES Heh; yeah, typo in my post. The file has it ok. Is there something I have to do to specify the interfaces which have nat enabled? Does natd_enable automatically forward any/every packet to any/every interface? SigmaX ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]
Gateway
I'm trying to setup a gateway/firewall on my network in a similar setup to that shown in the in the handbook diagram at http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-natd.html. I've followed what I can figure out, adding the following to my /etc/rc.conf gateway_enable=YES firewall_enable=YES firewall_type=OPEN natd_enabl=YES natd_interface=rl0 My understanding is that in FreeBSD 6 it's not necessary to recompile a kernal with IPFIREWALL and IPDIVERT, but appropriate modules will be loaded automatically. That said, the NAT and gateway stuff doesn't seem to be working properly, leastwise not when I try to connect from my Ubuntu Linux client (See thread here: http://ubuntuforums.org/showthread.php?t=224843) What all am I supposed to do to setup this gateway? SigmaX ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to [EMAIL PROTECTED]