Showing posts with label local. Show all posts
Showing posts with label local. Show all posts

Wednesday, 6 August 2014

Very fast editing over sshfs

Update: this can cause some of your ssh sessions to hang, so be aware of that.

Add this to your ~/.ssh/config

Host myserver.mydomain.com
  ControlMaster auto
  ControlPath /tmp/%r@%h:%p


Then, say you have root access via your ssh pub key

mkdir tmp001
sshfs -o uid=1000 root@myserver.mydomain.com:/var/www tmp001

Now, the files in tmp001 map to your remote /var/www directory. And access to them uses an ssh session that is maintained in your /tmp directory, i.e. all interactions are performed over the same ssh session.

To see the tmp file, if you just opened the sshfs session in the last 10 mins

find /tmp -mmin -10 -ls

Thursday, 5 June 2014

OpenVPN: push all LAN traffic through an OpenVPN client to the other side

  1. Local variables for this post, adjust to fit your setup:
    1. OpenVPN client server IP
      1. 192.168.1.200
    2. Remote network
      1. 172.16.1.0/24
  1. Add this to the client server that is using OpenVPN to connect to the remote server:
    1. sudo iptables -A POSTROUTING -o tun0 -j MASQUERADE
    2. as root user, do
      1. echo 1 > /proc/sys/net/ipv4/ip_forward
  2. Add this to your local computer 
    1. Linux: 
      1. ip route add 172.16.1.0/24 via 192.168.1.200
    2. Mac:
      1. route -n add 172.16.1.0/24 192.168.1.200
Now, you should be able to ping from your local computer, through the client machine, and to a server in the remote network. Once that works, try ssh.

NOTE: take a look at /etc/sysctl.conf if you want the ip_forward to last through reboots of client server: net.ipv4.ip_forward=1

Wednesday, 28 May 2014

unbound: custom records

server:
        verbosity: 1
        interface: 0.0.0.0
        access-control: 10.0.0.0/8 allow

        local-zone: "mydomain.internal" static
        local-data: "app01.mydomain.internal          IN A 10.0.0.10"
        local-data: "app02.mydomain.internal          IN A 10.0.0.11"
        local-data: "biggie01.mydomain.internal       IN A 10.0.0.12"
        local-data: "mysql01.mydomain.internal        IN A 10.0.0.20"
        local-data: "mysql02.mydomain.internal        IN A 10.0.0.31"
        local-data: "apache01.mydomain.internal       IN A 10.0.0.200"


Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...