You are not logged in.
Pages: 1
I need these three commands to be persistent. If I reboot my laptop I have manually to re-enter it each time.
# ip link set up dev enp20s0
# ip addr add 139.96.30.100/24 dev enp20s0
# iptables -t nat -A POSTROUTING -o wlp14s0 -j MASQUERADE
enp20s0 my ehternet adaptor.
wlp14s0 my wifi adaptor. Wifi boot up automatically.
Everyday iBiker
Offline
Are you using dhcp?
Offline
write a systemd unit file, e.g. https://wiki.archlinux.org/index.php/Ne … ng_systemd
Offline
Are you using dhcp?
I need dhcp for Wi-Fi, and manually set up ethernet connection.
Or i'll reserve an IP on my router for Wi-Fi adapters mac address. Disable the dhcp, and do everything according to the_shiver.
Last edited by tankas (2014-01-27 15:40:32)
Everyday iBiker
Offline
Wifi works automatically you say... but how? What is it using to connect automatically, and why can't you use the same tool to handle your static wired connection?
Offline
You should save iptables rule and let daemon handle loading it.
https://wiki.archlinux.org/index.php/Ip … ation_file
Configuring ethernet interface is most easily done through netctl profile.
Connection=ethernet
Interface=enp20s0
IP=static
## You can change address to something more memmorable, such as 10.0.0.1/8
IPCustom=('addr add 139.96.30.100/24 dev eth0')
AutoWired=yes
Save this as /etc/netctl/enp20s0-nat and enable it with netctl-ifplugd@enp20s0.service
This way profile gets started only after (re-)plugging ethernet cable. Just make sure you have ifplugd installed.
I assume you are doing all this to share internet access to another PC through ethernet.
In that case, you also need netctl profile on the other end. Enable it same way as you did on computer with internet access.
Interface=eth0
Connection=ethernet
IP=static
Address=('10.0.0.2/8')
Gateway='10.0.0.1'
## OpenDNS name server, so you don't need additional routing rules
DNS=('208.67.222.222')
AutoWired=yes
This should do it.
Offline
Pages: 1