You are not logged in.

#1 2014-01-27 14:49:03

tankas
Member
From: Dublin
Registered: 2013-12-27
Posts: 11

How to make 'eth0' boot up automaticaly?

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

#2 2014-01-27 14:51:40

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to make 'eth0' boot up automaticaly?

Are you using dhcp?

Offline

#3 2014-01-27 15:12:17

the_shiver
Member
Registered: 2013-03-27
Posts: 130

Re: How to make 'eth0' boot up automaticaly?

Offline

#4 2014-01-27 15:36:19

tankas
Member
From: Dublin
Registered: 2013-12-27
Posts: 11

Re: How to make 'eth0' boot up automaticaly?

karol wrote:

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

#5 2014-01-27 16:41:59

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to make 'eth0' boot up automaticaly?

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

#6 2014-01-27 16:46:45

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: How to make 'eth0' boot up automaticaly?

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

Board footer

Powered by FluxBB