Tag Info

Hot answers tagged

3

Here is how it does it: static int getdestaddr_iptables(int fd, const struct sockaddr_in *client, const struct sockaddr_in *bindaddr, struct sockaddr_in *destaddr) { socklen_t socklen = sizeof(*destaddr); int error; error = getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, destaddr, &socklen); if (error) { ...


2

The documentation is incomplete. The code contains the following list of error codes used internally: enum xtables_exittype { OTHER_PROBLEM = 1, PARAMETER_PROBLEM, VERSION_PROBLEM, RESOURCE_PROBLEM, XTF_ONLY_ONCE, XTF_NO_INVERT, XTF_BAD_VALUE, XTF_ONE_ACTION, }; And when it tries to initialize, it does: if (!*handle) ...


2

Can you do this? [root@myelastix ~]# telnet 192.168.1.94 5029 If not, make sure telnetd is configured to listen on external interface. netstat -tulpn | grep :5029


2

If you used iptables -v -L instead of iptables-save you would be noticed that that's the amount of packets:bytes that has passed trough that specific chain. My own example: ➜ ~ sudo iptables-save # Generated by iptables-save v1.4.21 on Fri Oct 31 11:08:58 2014 *filter :INPUT ACCEPT [269:87691] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [234:37262] COMMIT # ...


1

A line beginning with a colon and a rule name, like :INPUT ACCEPT [0:0], resets the corresponding chain: any previous rules are flushed. If you want to add rules, add -A INPUT … lines. There should be a single :CHAIN line for each chain in /etc/sysconfig/iptables, coming before any other rule that references that chain. Thus whatever rules were already there ...


1

I found out what happened - the new rule overrode all the previous rules, leaving only the SSH and VNC ports open. I added the VNC rules to the previous config in the file. Solved!


1

Per your comment: @Marki - computers A and B are on the internet. When they go to someserver.com, they always do so from my Linux box (e.g. specific routing). A and B cooperate. On occasion, we want computer B to go to someserver.com without someserver being aware requests are coming from a different machine. Am I missing something here? If ...


1

For general access, you'll have to use MASQUARADE / SNAT (depending if your IP address on C is dynamic or static). So let's say current situation is your computer A has static IP address a.a.a.a, and your computer B has static IP address b.b.b.b. Both have default gateway to computer C. And Someserver.com has static IP address r.r.r.r and secret port is ...


1

I think that what you need is a port forwarder. Set up a port forwarder on the public V2 listening to port 80, and forwarding to H port 8080. ssh can be used to do this, as it does it securely, as long as you can ssh into your home network (the port number does not matter, you can set up ssh on any port you like). There may be other port forwarders, ...


1

Iptables is not like a pam configuration file where the first rule satisfies a procedure. In iptables, ALL rules must be satisfied. This is completely wrong. The rules are traversed in order, and when a rule that matches jumps to one of the built-in targets (ACCEPT, DROP or QUEUE), the processing of the packet ends there: no more rules are traversed. ...


1

I don't know how to do this with the shell. But since the script is already trapping the interrupt signal, you might as well leverage that and add an extra command there as you can execute commands with that interpreter, like so: #!/usr/bin/env ruby require 'webrick' system *%W(sudo iptables -I INPUT -p tcp --dport 3000 -j ACCEPT) server = ...


1

It depends on how foolproof you want the block to be, and how much you control the system. Since you talk about your "home system" and modifying /etc/hosts, I assume that you have legitimate root access and it doesn't need to be totally bullet-proof. The easiest way to block access to an entire domain is to set up a local DNS "recursive resolver" and ...


1

The only rule for exit codes is that 0 means success and any other value means failure. This rule goes beyond unix: it's also a very convention on other operating systems (including DOS, Windows, and many embedded systems that have a notion of exit code, but VMS does things differently). In unix systems, it's baked into the shell's boolean constructs (if, ...



Only top voted, non community-wiki answers of a minimum length are eligible