Tunnel remote port 8383 to become available as localhost:5433
ssh -L 5433:localhost:8383 some-user@some-server |
Tunnel remote port 8383 to become available as localhost:5433
ssh -L 5433:localhost:8383 some-user@some-server |
Change internet default route in Mac OS X to USB HSDPA modem stick with LAN’ certain subnet routed via a gateway in WiFi (en1
).
In my case DNS will go with the modem interface setting remain routed via USB modem stick
before routing:
$ netstat -nr Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 10.64.64.64 UGSc 72 137 ppp0 default link#4 UCSI 0 0 en0 default 10.1.1.1 UGScI 0 0 en1 |
Delete and add routes (desired LAN subnet 192.168.1.0/24:
sudo route -n delete default 10.1.1.1 sudo route -n add default 10.64.64.64 sudo route -n add 192.168.1.0/24 10.1.1.1 |
after routing:
$ netstat -nr Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 10.64.64.64 UGSc 21 0 ppp0 default link#4 UCSI 0 0 en0 default 10.1.1.1 UGScI 0 0 en1 10.1.1/24 link#5 UCS 6 0 en1 ... 192.168.1 10.1.1.1 UGSc 0 0 en1 ... |
Socket monitoring by watching receive and send queue every 5 seconds
$ while true; do netstat -tn; sleep 5; clear; done |
Result:
Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 10.238.133.152:43941 98.136.48.103:5050 ESTABLISHED tcp 1 0 10.238.133.152:42541 8.27.254.249:80 CLOSE_WAIT tcp 1 0 10.238.133.152:34355 184.73.222.16:80 CLOSE_WAIT tcp 0 0 10.238.133.152:43210 199.59.148.87:443 ESTABLISHED tcp 0 229 10.238.133.152:43209 199.59.148.87:443 ESTABLISHED |
This is to emulate combination of watch
and ss
in Solaris, more or less same result
$ watch -n 5 ss -t |
State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 0 10.238.133.152:36045 74.125.224.250:https ESTAB 0 0 10.238.133.152:36044 74.125.224.250:https CLOSE-WAIT 1 0 10.238.133.152:59622 174.129.233.179:www ESTAB 0 0 10.238.133.152:43941 98.136.48.103:mmcc CLOSE-WAIT 38 0 10.238.133.152:49300 199.59.148.87:https ESTAB 0 0 10.238.133.152:33626 74.125.224.191:https CLOSE-WAIT 1 0 10.238.133.152:37621 208.46.163.81:www |
Check route/gateway in Solaris
# netstat -rn Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- default 192.168.40.1 UG 1 0 192.168.40.0 192.168.40.91 U 1 2 e1000g2 224.0.0.0 192.168.40.91 U 1 0 e1000g2 127.0.0.1 127.0.0.1 UH 1 0 lo0 |
If no /etc/defaultrouter
set (file not exist), booting will set no default gateway as
# netstat -rn Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- 192.168.40.0 192.168.40.91 U 1 2 e1000g2 224.0.0.0 192.168.40.91 U 1 0 e1000g2 127.0.0.1 127.0.0.1 UH 1 0 lo0 |
Single permanent IP (up on boot) on one interface:
/etc/inet/hosts content:
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.40.91 cxnode01 .cxnode01 loghost
192.168.40.92 cxnode02
The interface where you want to bind the above ip: /etc/hostname.e1000g2
containing
cxnode01
Change hostname etc.
/etc/hosts
/etc/nodenames
/etc/hostname.[device]
/etc/defaultrouter
/etc/defaultdomain
/etc/nodename