Re: what's the right way to resolve localhost's IPs

2023-03-30 Thread fh

On 2023-03-30 13:38, Emanuel Berg wrote:

fh wrote:


In my shell script, how to get the localhost's IPs (eth0 and
eth1) correctly? I know I can run 'ifconfig' and grep etc,
but it's maybe not that graceful.


Here is what I do, now idea if it's a good idea but maybe it
can help:

#! /bin/zsh
#
# this file:
#   https://dataswamp.org/~incal/conf/.zsh/ip

public-ip () {
local name=$funcstack[1]
local url='http://checkip.amazonaws.com'
local open_dns=opendns.com
echo $(curl --no-progress-meter $url) "($name)"
dig +short myip.${open_dns} @resolver1.${open_dns}
}

inet () {
local name=$funcstack[1]
echo $(hostname -I | awk '{print $1}') "($name)"
ifconfig $net | awk '/mask/{print $2}'
ip addr show $net | awk '/inet /{print $2}' | cut -d '/' -f 1
}

list-ip () {
public-ip
inet
}
alias lip=list-ip

# $ lip
# 92.34.142.23
# 92.34.142.23
# 192.168.10.224
# 192.168.10.224
# 192.168.10.224



i like the JSON output just b/c I am a programmer knowing JSON pretty 
well. :)




Re: cpan oddity

2023-03-26 Thread fh

On 2023-03-27 08:21, Jude DaShiell wrote:

I ran cpan and did quick configuration and chose sudo to elevate
privileges when necessary.  Unfortunately I don't have write access on
/usr/local/bin so cpan is crippled.


-- Jude  "There are four boxes to be used in
defense of liberty: soap, ballot, jury, and amo. Please use in that
order." Ed Howdershelt 1940.


try cpanminus?
$ sudo apt install cpanminus



Re: Question for this IP's PTR

2023-03-24 Thread fh

On 2023-03-25 08:32, Greg Wooledge wrote:

On Sat, Mar 25, 2023 at 08:28:03AM +0800, f...@dnsbed.com wrote:

Greetings,

as you see this PTR,

$ dig -x 1.1.1.1 +short
one.one.one.one.

so 2.2.2.2 can have the PTR two.two.two.two? and 3.3.3.3 can have
three.three.three.three?


Any IP address can have any PTR value.  You just have to petition the
owner of the IP address range to set it.

I didn't know .one was a valid TLD.  It looks like .two is not, so if
someone were to assign "two.two.two.two" as the PTR value of an IP
address, that PTR would not resolve back to any IP address.  (An IP
address block owner might reject such a petition.)



Thanks Greg.
I also don't know .one is a valid TLD, looks surprising.

But, one.one is owned by a domain registrar (one.com), while 
one.one.one's zone owner is cloudflare.


$ dig one.one soa +short
a.b-one-dns.net. hostmaster.one.com. 2013010101 1800 900 1209600 300

$ dig one.one.one soa +short
fred.ns.cloudflare.com. dns.cloudflare.com. 2305085481 1 2400 604800 
3600


maybe they co-work for this domain.


regards.



Question for this IP's PTR

2023-03-24 Thread fh

Greetings,

as you see this PTR,

$ dig -x 1.1.1.1 +short
one.one.one.one.

so 2.2.2.2 can have the PTR two.two.two.two? and 3.3.3.3 can have 
three.three.three.three?


Sorry I am not good at the DNS knowledge.

Regards.



Re: Small Installation Image - Installed

2023-03-22 Thread fh

VNC? which would let you have the chance to install SSH server.

On 2023-03-23 01:25, Macauley Clark wrote:

Hello,

I hope this email finds you well, I have installed Debian 11 on my HPE
server and have tried to access it using SSH but found that SSH isn't 
an

included package, from what I read.

I don't particularly want to have to install Debian 11 again because 
the

binaries had to be uploaded by the Datacenter who hosts my hardware.

Anything you can suggest would be appreciated.

Thanks,




Re: what's the right way to resolve localhost's IPs

2023-03-21 Thread fh

On 2023-03-22 10:06, Jeremy Ardley wrote:

On 22/3/23 09:12, f...@dnsbed.com wrote:

Hello,

In my shell script, how to get the localhost's IPs (eth0 and eth1) 
correctly?
I know I can run 'ifconfig' and grep etc, but it's maybe not that 
graceful.


On Debian the preferred  command is

root@debian12:~# ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN 
group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
   valid_lft forever preferred_lft forever
2: enp0s3:  mtu 1500 qdisc fq_codel 
state UP group default qlen 1000

    link/ether 08:00:27:18:b6:ac brd ff:ff:ff:ff:ff:ff
    inet 10.31.40.166/24 brd 10.31.40.255 scope global dynamic enp0s3
   valid_lft 81816sec preferred_lft 81816sec
    inet6 2403:5800:c101:b700:a00:27ff:fe18:b6ac/64 scope global 
dynamic mngtmpaddr

   valid_lft 6667sec preferred_lft 3066sec
    inet6 fe80::a00:27ff:fe18:b6ac/64 scope link
   valid_lft forever preferred_lft forever

You can also output in .json format

root@debian12:~# ip -j a


[{"ifindex":1,"ifname":"lo","flags":["LOOPBACK","UP","LOWER_UP"],"mtu":65536,"qdisc":"noqueue","operstate":"UNKNOWN","group":"default","txqlen":1000,"link_type":"loopback","address":"00:00:00:00:00:00","broadcast":"00:00:00:00:00:00","addr_info":[{"family":"inet","local":"127.0.0.1","prefixlen":8,"scope":"host","label":"lo","valid_life_time":4294967295,"preferred_life_time":4294967295},{"family":"inet6","local":"::1","prefixlen":128,"scope":"host","valid_life_time":4294967295,"preferred_life_time":4294967295}]},{"ifindex":2,"ifname":"enp0s3","flags":["BROADCAST","MULTICAST","UP","LOWER_UP"],"mtu":1500,"qdisc":"fq_codel","operstate":"UP","group":"default","txqlen":1000,"link_type":"ether","address":"08:00:27:18:b6:ac","broadcast":"ff:ff:ff:ff:ff:ff","addr_info":[{"family":"inet","local":"10.31.40.166","prefixlen":24,"broadcast":"10.31.40.255","scope":"global","dynamic":true,"label":"enp0s3","valid_life_time":81787,"preferred_life_time":81787},{"family":"inet6","local":"2403:5800:c101:
b700:a00:27ff:fe18:b6ac","prefixlen":64,"scope":"global","dynamic":true,"mngtmpaddr":true,"valid_life_time":6638,"preferred_life_time":3037},{"family":"inet6","local":"fe80::a00:27ff:fe18:b6ac","prefixlen":64,"scope":"link","valid_life_time":4294967295,"preferred_life_time":4294967295}]}]


and if you write a script like this (and make it write protected and 
executable)


 cat ipv4_addresses.py
#!/usr/bin/env python3
import json
import sys

data = sys.stdin.read()

interfaces = json.loads(data)

for interface in interfaces:
    ifname = interface['ifname']
    for addr_info in interface['addr_info']:
    if addr_info['family'] == 'inet':
    ipv4 = addr_info['local']
    print(f"{ifname}: {ipv4}")

you can do

ip -j a | ./ipv4_addresses.py
lo: 127.0.0.1
enp7s0: 10.31.40.68

or on a fancier setup



Thanks a lot. Now I prefer this way:
$ ip -j a|python3 -mjson.tool

regards.



what's the right way to resolve localhost's IPs

2023-03-21 Thread fh

Hello,

In my shell script, how to get the localhost's IPs (eth0 and eth1) 
correctly?
I know I can run 'ifconfig' and grep etc, but it's maybe not that 
graceful.


Thanks
Corey



Re: debian server with two public IPs

2023-03-20 Thread fh





https://lartc.org/ will help you.
Exactly https://lartc.org/howto/lartc.rpdb.multiple-links.html
In my same setup i was add some 'up ip rule add ...' lines into
/etc/network/interfaces


I finally resolved the issue with the helps of your article and this 
one:

https://blog.scottlowe.org/2013/05/29/a-quick-introduction-to-linux-policy-routing/

Thanks a lot.



debian server with two public IPs

2023-03-20 Thread fh

Hello list,

I have a networking question that I can't understand for.
I have the Debian 11 host with two ethernet cards.
There is public IP and gateway for each ethernet card.
(they are public IPs from two different net address blocks.)

Say:
eth0 ip: 193.36.132.10  gw: 193.36.132.1
eth1 ip: 5.255.106.10 gw: 5.255.106.1

The system's default gw is the first one (eth0).
When clients from outside access eth1 ip (such as HTTP access), they can 
reach there.
But, the returned packages from debian server to clients are always 
coming from eth0 gw.
I expect the returned package also come from eth1 gw (since clients are 
accessing eth1 address).


How can I setup this? Thanks for any hints.

regards
Corey H



Re: question about net address

2023-03-19 Thread fh

On 2023-03-20 07:36, Jeremy Ardley wrote:

As for the RFC? It's precise and definitive. My only concern is that 
some mail system implementer may 'improve' the RFC and restrict the 
acceptable address range to a /32 when they see a non zero final qnum 
in a /24


me second. 192.168.1.1/24 just makes me confused with 192.168.1.1/32 
which is a real host address. for block address it should be clearly 
192.168.1.0/24.


Thanks
Corey H



Re: question about net address

2023-03-19 Thread fh

On 2023-03-19 19:01, Yassine Chaouche wrote:


It only knows about saying things that sound plausible,
not necessarily true.
It doesn't fetch info from the internet,
process it,
then give it you.
It rather generates text,
using statisics.

Don't get mislead by it.
It often gives wrong answers.



For this kind of definition with clear rules (SPF), I think chatGPT is 
more precise than person.


regards
FengHe



Fehler in der Debian-Installation (debian-installer) Raid, lilo und externen Controller (Sarge Netinstall aktuelle Version)

2005-06-20 Thread Gladewitz, Robert (FH)
Hallo,

ich habe festgestellt, dass bei Sarge-Installation folgende Installationsteile 
Fehlerhaft sind:

Fehler 1 Boot-Manager Installation:
---
Bei Auswahl von Raid/Root Platten zur Installation oder
bei der Standardinstallation wir ein Fehler am Punkt
Installation Grub erzeugt, der nicht ganz 
Interpretierbar ist:

 - Keine weiteren Hinweis auf Konsole 3
 - keine abgeschlossene Installation des
   Boot-Managers

Das Selbe Phänomen tritt auf, falls das Motherboard einen
zusätzlichen DMA-Controller oder ein zusätzlicher Raid/DMA-
Controller im System vorhanden ist, und somit /dev/hda nicht
die erste Festplatte ist.

Zudem Frage ich mich, ob Grub überhaupt Raid-Systeme unterstützt?
Lilo kann mit Raid1 und Raid 0 umgehen, sollte man nicht eher Lilo
Als Standard-Bootmanager verwenden??


Fehler 2 Lilo wird nicht bei Auswahl Installieren Boot Lilo installiert
-
Dieser Fehler ist relativ unlogisch. Nachdem der Grub versagt hat, versuch
man ja den lilo als Bootmanager zu installieren. Wieder erscheint die
gleiche (siehe Fehler 1). Dann habe ich versucht im Target mit chroot
das installierte System zu testen - siehe da, keine Lilo installiert. Auch
auch der CD (Netinstall, aktuellste Version) ist kein Lilo zu finden! Absicht??


Mit freundlichen Grüßen

Robert Gladewitz

Fachhochschule Heidelberg
DV-Technik und DV-Administration
Internet: www.fh-heidelberg.de
E-Mail: [EMAIL PROTECTED]


Priv:
E-Mail: [EMAIL PROTECTED]
Internet: www.gladewitz.de




Fehler in der Debian-Installation (debian-installer) Raid, lilo und externen Controller (Sarge Netinstall aktuelle Version)

2005-06-20 Thread Gladewitz, Robert (FH)
Hallo,

ich habe festgestellt, dass bei Sarge-Installation folgende Installationsteile 
Fehlerhaft sind:

Fehler 1 Boot-Manager Installation:
---
Bei Auswahl von Raid/Root Platten zur Installation oder
bei der Standardinstallation wir ein Fehler am Punkt
Installation Grub erzeugt, der nicht ganz 
Interpretierbar ist:

 - Keine weiteren Hinweis auf Konsole 3
 - keine abgeschlossene Installation des
   Boot-Managers

Das Selbe Phänomen tritt auf, falls das Motherboard einen
zusätzlichen DMA-Controller oder ein zusätzlicher Raid/DMA-
Controller im System vorhanden ist, und somit /dev/hda nicht
die erste Festplatte ist.

Zudem Frage ich mich, ob Grub überhaupt Raid-Systeme unterstützt?
Lilo kann mit Raid1 und Raid 0 umgehen, sollte man nicht eher Lilo
Als Standard-Bootmanager verwenden??


Fehler 2 Lilo wird nicht bei Auswahl Installieren Boot Lilo installiert
-
Dieser Fehler ist relativ unlogisch. Nachdem der Grub versagt hat, versuch
man ja den lilo als Bootmanager zu installieren. Wieder erscheint die
gleiche (siehe Fehler 1). Dann habe ich versucht im Target mit chroot
das installierte System zu testen - siehe da, keine Lilo installiert. Auch
auch der CD (Netinstall, aktuellste Version) ist kein Lilo zu finden! Absicht??


Mit freundlichen Grüßen

Robert Gladewitz

Fachhochschule Heidelberg
DV-Technik und DV-Administration
Internet: www.fh-heidelberg.de
E-Mail: [EMAIL PROTECTED]


Priv:
E-Mail: [EMAIL PROTECTED]
Internet: www.gladewitz.de