Recent Notes

Displaying keyword search results 1 - 10
Created by voodoo on January 11, 2013 09:36:27    Last update: January 11, 2013 09:39:03
Redsocks is a transparent socks/proxy redirector. You use iptables to redirect TCP traffic to redsocks, redsocks will forward to upstream SOCKS4, SOCKS5 or HTTPS proxy server. Once set up, the redirection is system wide, so you don't have to set up proxy for each individual application. It is useful when you have to use a SOCKS or proxy server to make the connection but the application does not support proxy settings (for example, the Android browser). Linux/iptables, OpenBSD/pf and FreeBSD/ipfw are supported. Sample configuration file : base { log_debug = off; log_info = off; ... According to the project home page , redsocks is used by ProxyDroid to provide system-wide proxy on rooted Android devices.
Created by voodoo on August 03, 2012 08:42:38    Last update: August 03, 2012 09:31:25
The C function getsockopt lets you get the error codes with the option SO_ERROR . The possible error numbers are defined in the global errno.h . The relevant values are: #define ETIMEDOUT 110 /* Connection timed out */ ... But here's the whole list on my Linux system ( /usr/include/asm-generic/errno.h ): #ifndef _ASM_GENERIC_ERRNO_H #define _ASM_GENER...
Created by magnum on September 27, 2011 13:57:23    Last update: October 03, 2011 13:02:34
After an IPSec connection is established, all traffic between the network interfaces named in /etc/ipsec.conf are tunneled through IPSec. And only the protocols and ports listed in /etc/ipsec.conf are allowed. For example, if you were able to ssh to the server, after IPSec connection ssh is no longer working if port 22 is not listed. Assume that you set up IPSec tunnel between the hosts 192.168.0.1 and 192.168.0.101 , these tests will show that the IPSec connection is successfully working. Before bringing up IPSec connection If IPSec connection is already established, bring it down: # ipsec auto --down TCP8080-PSK-CLIENT Monitor server port 8080 with tcpdump ( 192.168.0.1 ): # tcpdump -i eth0 port 8080 -X On server side ( 192.168.0.1 ), listen on port 8080:...
Created by magnum on September 27, 2011 12:55:51    Last update: September 27, 2011 12:55:51
These steps set up a Linux host as IPSec client, using Openswan . Install Openswan: # yum install openswan Edit /etc/ipsec.conf . Instead of L2TP on port 1701, I'm setting up TCP on port 8080 so that I can test the connection with nc . # /etc/ipsec.conf - Openswan IPsec configuration f... Edit /etc/ipsec.secrets . # include /etc/ipsec.d/*.secrets 192.168.0.101 ... Start IPSec: # /etc/init.d/ipsec start Connect to IPSec server: # ipsec auto --up TCP8080-PSK-CLIENT 104 "TCP80...
Created by magnum on September 27, 2011 09:32:18    Last update: September 27, 2011 09:33:04
Use tcpdump to monitor traffic on a network: To print all incoming and outgoing packets on host 192.168.0.1 : tcpdump host 192.168.0.1 To print all incoming and outgoing IP packets on host firebird : tcpdump ip host firebird To write raw packets to a file, rather than parsing and printing them out: tcpdump ip host firebird -w /tmp/firebird.pcap To listen on interface eth0 (without this, tcpdump listens on the lowest numbered, configured up interface except loopback): tcpdump -i eth0 ip Use switch -X for more verbose output: tcpdump -i eth0 ip -X host 192.168.0.1 Outgoing from 192.168.0.1 : tcpdump -i eth0 ip -X src host 192.168.0.1 Incoming to 192.168.0.1 : tcpdump -i eth0 ip -X dst host 192.168.0.1 More verbose output: tcpdump -i eth0 tcp -vvX host 192.168.0.1...
Created by magnum on September 21, 2011 16:01:16    Last update: September 21, 2011 16:02:33
More like assign a second ip address to the same nic, instead of a virtual nic. Multiple IP addresses can be assigned to the same NIC, but all IP addresses must be on the same subnet - otherwise some IP addresses will not be accessible. From command line, assign IP address 192.168.0.2 to alias eth0:0 : sudo ifconfig eth0:0 192.168.0.2 netmask 255.255.2... But IP addresses added this way are not persistent. They are lost whent he OS is restarted. To make the additions persistent: For Fedora: $ su - # cd /etc/sysconfig/network-scripts/ ... The contents of ifcfg-eth0:0 should look like this: DEVICE=eth0:0 IPADDR=192.168.0.2 NETMASK=255... Restart network: # service network restart For Ubuntu: $ sudo vi /etc/network/interfaces Append this to the file: auto eth0:0 iface eth0:0 inet static name Et......
Created by magnum on September 21, 2011 12:35:14    Last update: September 21, 2011 12:35:14
NAME brctl - ethernet bridge administration SYNOPSIS brctl [command] DESCRIPTION brctl is used to set up, maintain, and inspect the ethernet bridge configuration in the linux kernel. An ethernet bridge is a device commonly used to connect different networks of ethernets together, so that these ethernets will appear as one ethernet to the participants. Each of the ethernets being connected corresponds to one physical interface in the bridge. These individual ethernets are bundled into one bigger ('logical') ethernet, this bigger ethernet corresponds to the bridge network interface.
Created by magnum on September 16, 2011 16:04:05    Last update: September 16, 2011 16:05:06
Linux distros come with PPTP client bundled. This is how to configure Linux as PPTP client: Click System->Preferences->Network Connections: Select the VPN tab, click Add : Select PPTP from the list and click Create... : To connecto to the PPTP VPN: click the Network icon on the launch Panel and select the VPN name just created.
Created by woolf on July 29, 2011 08:34:34    Last update: July 29, 2011 08:34:34
This errors out, but will remove an assigned IP address anyway: $ sudo ifconfig eth0 0.0.0.0 netmask 0.0.0.0 if...
Created by woolf on July 05, 2011 15:38:52    Last update: July 05, 2011 15:39:55
By default VirtualBox enables one network adapter ("Adapter 1") with NAT. Connection from the guest OS to the outside world works natually when the guest network adapter is assigned an IP address by the VirtualBox DHCP server. Use VBoxManage to see a list of DHCP servers: $ VBoxManage list dhcpservers NetworkName: H... The guest IP address is not visible from the outside world. If you need to access a server on the guest OS, you need to set up port forwarding in VirtualBox settings: Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding . Beware that on Linux/Unix, port forwarding may not work if you bind to a privileged port (port number < 1024) but you are not root. Bridged networking can be...
Previous  1 2 3 Next