netstat -nr 하면 라우팅테이블 나오는데
이게 순서가 거꾸로임. 맨 아래가 제일 우선순위가 높은거고, 위가 마지막우선순위인식...
그래서 172.16... 이런부분은 최상위 우선순위고 내가 route -add 해서 더하는건 127.0.0 바로 아래정도에 삽입됨
sh-3.2# netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGSc 65 0 en0
127 127.0.0.1 UCS 1 0 lo0
127.0.0.1 127.0.0.1 UH 4 519142 lo0
169.254 link#4 UCS 1 0 en0
172.16/24 link#12 UC 3 0 vboxnet
172.16.0.10 8:0:27:64:eb:fb UHLWIi 4 68 vboxnet 1034
172.16.0.255 link#12 UHLWbI 1 18 vboxnet
192.168.1 link#4 UCS 4 0 en0
192.168.1.1/32 link#4 UCS 2 0 en0
192.168.1.1 a0:63:91:47:85:c5 UHLWIir 67 119 en0 1102
192.168.1.8/32 link#4 UCS 1 0 en0
192.168.1.18 c4:d9:87:e9:37:e3 UHLWIi 1 1 en0 1128
192.168.1.23 54:26:96:ce:8c:a7 UHLWIi 1 0 en0 1147
192.168.1.255 link#4 UHLWbI 1 18 en0
192.168.61 link#11 UC 5 0 vmnet8
192.168.61.128 0:c:29:8c:61:c2 UHLWIi 1 0 vmnet8 1037
192.168.61.166 0:c:29:9f:5b:6f UHLWIi 2 19 vmnet8 1089
192.168.61.255 link#11 UHLWbI 1 19 vmnet8
192.168.157 link#10 UC 3 0 vmnet1
192.168.157.255 link#10 UHLWbI 1 18 vmnet1
224.0.0 link#4 UmCS 2 0 en0
224.0.0.251 1:0:5e:0:0:fb UHmLWI 1 24 en0
255.255.255.255/32 link#4 UCS 2 0 en0
255.255.255.255 link#4 UHLWbI 1
아래같은식으로 네트워크주소에 대한 gateway 주소를 넣어주고 삭제해주고 하면됨
나중에 add 하는게 우선순위가 높음.
route -n add -net 10.67.0.0
/16
192.168.120.254
Adding a route manually can be necessary sometimes. When on Linux, I know the command by head:
1 | sudo route add -net 10.67.0.0 /16 gw 192.168.120.254 |
On the Mac the command is similar, but a bit different Just as a note to myself and anyone else interested:
1 | sudo route -n add -net 10.67.0.0 /16 192.168.120.254 |
This sets up a route to the 10.67.0.0/16 net through gateway 192.168.120.254. First one on Linux, second one on Mac OSX.
'Programming' 카테고리의 다른 글
BPF vs eBPF (0) | 2018.05.18 |
---|---|
system, execl, exeve PATH 차이 (0) | 2016.09.09 |
ARM DACR basics (0) | 2016.07.13 |
Intel SGX basics (1) | 2016.07.12 |
Mount QEMU qcow image (0) | 2015.12.17 |