LoginSignup
3
4

More than 5 years have passed since last update.

Ubuntu15.04をルータ化(インターネット<->無線(ubuntu)有線<->他のPC)

Last updated at Posted at 2015-06-08

参考

ルータ化したい端末にて実施

/etc/sysctl.conf
+ net.ipv4.ip_forward=1
設定反映
sudo sysctl -p
  • 以下この端末の有線LAN側のIPアドレスを192.168.9.9/24に固定した例で進める。

インターネットに出たい他の端末にて実施

/etc/resolv.conf
nameserver 192.168.9.9
/sbin/route add default gw 192.168.9.9

ネットに出られることを確認。

dhcpサーバを建てたい場合

./dnsmasq.conf
interface=eth0
no-daemon
dhcp-range=192.168.9.10,192.168.9.23,12h
dhcp-option=3,192.168.9.9
  • 分かり辛いが、デフォルトゲートウェイは dhcp-option=3,ipaddrで指定。
sudo dnsmasq --conf-file=dnsmasq.conf
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4