通过网线传输大文件

如果电脑自带以太网口,那么只需要一根网线,否则需要USB有线网卡。

  • MacBook: 192.168.0.1/24 (en4) 👈 用了USB有线网卡
  • RaspberryPi: 192.168.0.x/24 (eth0) 👈 会自动获取IP地址
# install software
$ brew install dnsmasq

# setup static ip
$ sudo ifconfig en4 192.168.0.1/24

# run dhcp service (注意观察日志, 结束后按^C退出)
$ sudo dnsmasq -d -i en4 -F 192.168.0.100,192.168.0.200
dnsmasq: started, version 2.84rc2 cachesize 150
dnsmasq-dhcp: DHCP, IP range 192.168.0.100 -- 192.168.0.200, lease time 1h
dnsmasq-dhcp: DHCPREQUEST(en4) 192.168.0.119 xx:xx:xx:xx:xx:xx
dnsmasq-dhcp: DHCPACK(en4) 192.168.0.119 xx:xx:xx:xx:xx:xx raspberrypi

# transfer bigfile
$ scp bigfile pi@192.168.0.119:

# clear static ip
sudo ifconfig en4 delete 192.168.0.1