Receive Internet and share it with the same wifi card

Hello. I am pretty new on Manjaro and my last gnu-linux experience was like 20 years ago. Got two questions already. I am changing my laptop ttl to 65 in order to use my mobile Internet. How can I make it permanent? I am typing “sudo sysctl net.ipv4.ip_default_ttl=65” on every login in order to get Internet but cant find the sysctl.conf to make it permanent.

Also, I made an access point by using create_ap command “create_ap wlan0 wlan0 sidd pass” and using its linux-wifi-hotspot gui as well. Both created the hotspot but neither had Internet. Any other way to do this?

Thanks in advance.

Hi @Woodsoul, and welcome!

I’m not sure if this is at all the best, or even preferred way of doing it, but I can think of one way to do this.

  1. Add the command to the sudoers file to allow you to run it with no password. But editing the sudoers file is dangerous and not recommended, so create a file in /etc/sudoers.d/ and add it there.

    For example:

    nano /etc/sudoers.d/mirdarthos
    

    Note: You can use any file name, I’m using mirdarthos because it’s my username.

  2. In the newly created file add the sydoers line that specfies your user can execute a command without requiring a password.

    For example:

    <username> ALL=(ALL) NOPASSWD: <command>
    

    Where:

    • <username is thee user name of the user that is to be allowed to run the command as root without a password.
    • ` is the command that is to be allowed.

    For example:

    mirdarthos ALL=(ALL) NOPASSWD: /usr/bin/cpupower frequency-set -g performance
    

    The above line allows me, mirdarthos to exeecute the /usr/bin/cpupower frequency-set -g performance command, to set my CPU governor to performance, as root.

    So your line would probably be something like this:

    <username> ALL=(ALL) NOPASSWD: sysctl net.ipv4.ip_default_ttl=65
    

    Just replace the <username> with your actual username.

    Note: You might need to use the full path to sysctl in the command, unsure of this.

    Then you can just setup the command sudo sysctl net.ipv4.ip_default_ttl=65 to execute at login.

    If you need it at boot, well then I recommend you create a systemctl unit, but I haven’t done that yet, and is above my head.

1 Like

you would create a file in the
/etc/sysctl.d
directory
the syntax is not the same as in the command - but similar
… ahh, @Mirdarthos said it already, kind of
by creating that file with your content, you don’t need all that sudoers editing …

You need two create two interfaces on this one card - and connect them.
For instance, one in Master mode, one in Client mode.
Not all cards or drivers support this.

There are probably many resources on how to achieve this.
I myself use a Wlan-router running OpenWRT with the package “travelmate” on it.
This does the exact same thing as you want to do - perhaps you can glean inspiration from there.

Tee hee hee. Took me some time to type it.

1 Like

Most don’t as you need 2 “antennas” (=more expensive so even on high end systems manufacturers cut costs)
If that’s true for your card too (we have no information and why it’s best to always post an inxi --admin --verbosity=7 --filter --no-host --width) then you need an additional WiFi card (or an additional dongle; look whether it’s Linux compatible or not before buying it!)

:crossed_fingers:

Objection! :wink:
two interfaces on one radio is possible with a lot of hardware
My cheap plastic router can do it - I have a TP-Link too old to run the most recent version of OpenWRT
so I now use a FritzBox 7412 - because it was cheap with (comparably) lots of memory and cpu power

1 Like

Sustained! :grin:

I just tried to make things easy to understand. Edited antennas to reflect “antennas”…

:joy:

P.S. Danke schön! :stuck_out_tongue_winking_eye:
P.P.S. Most Wifi Cards have dual antennas for 2.4 and 5GHz already, but the same antennas can indeed be used for an infrastructure and an access point connection whereas Windows can do that on all hardware by spinning off yet another service eating CPU and RAM and fast switching between the two, halving the bandwidth, whereas Linux refuses to do that and needs a chipset capable of both Infrastructure and access point connections simultaneously not using any RAM / CPU / … Habe ich dich glücklich gemacht? :innocent:

1 Like

Only if the adapter supports AP mode.

iw list | less -p "Supported interface modes"

Also see: Software access point - ArchWiki

2 Likes

And don’t forget the driver and firmware combo. Even if it is the hardware supports it, not every driver for a Linux system supports it.

1 Like