Archive for the 'Network' Category

Getting NetworkManager to send your hostname to DHCP Server in Fedora 13

June 2, 2010

Network Manager in Fedora still ignores the old system wide /etc/dhclient.conf(it’s rude like that), so you would have to create a /etc/dhclient-$IFNAME.conf
to get it to work. The contents will still be the usual:

send host-name "my.little.pony";
request subnet-mask, broadcast-address, time-offset, routers,
domain-search, domain-name, domain-name-servers, host-name;

I don’t request much, but I do make demands. After you may safely right click you’re nm-applet icon and select your current connection, it will re-initialize(I may be phrasing this wrong) you current connection and you’re set!

Jumping into local Only.

November 18, 2007

After reading Stefano Rivera’s (tumbleweed) post about local only ADSL accounts I had decided to implement the idea on my home network, which has an overworked 400mhz celeron box, running debian between my router and switch doing masquerading.
I fired up my favourite terminal and started off my creating another provider script for the new IS account. I modified Stefano’s source routing script and created a script in /etc/ppp/ip-up.d/ to setup the routing accordingly.

root@hopkin:/etc/ppp/ip-up.d# cat setuprouting
#!/bin/sh
# based on tumbleweed’s split routes script
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
ROUTES=/etc/routes/localroutes

# Is this our internal ppp session?
if [ “$PPP_IFACE” = “ppp0” ]; then
peer=`ip addr show dev $PPP_IFACE | sed -n ‘/inet/ s#.* peer \([0-9.]*\)/.*#\1# p’`
address=`ip addr show dev $PPP_IFACE | sed -n ‘/inet/ s/.* inet \([0-9.]*\) .*/\1/ p’`

ip route add “$peer” dev “$PPP_IFACE” src “$address” table 1
ip route add default via “$peer” table 1
ip rule add from “$address” table 1
fi

# Is this our local ppp session?
if [ “$PPP_IFACE” = “ppp1” ]; then
cat “$ROUTES” | while read route; do
ip route add “$route” dev “$PPP_IFACE”
done

peer=`ip addr show dev $PPP_IFACE | sed -n ‘/inet/ s#.* peer \([0-9.]*\)/.*#\1# p’`
address=`ip addr show dev $PPP_IFACE | sed -n ‘/inet/ s/.* inet \([0-9.]*\) .*/\1/ p’`

ip route add “$peer” dev “$PPP_IFACE” src “$address” table 1
ip route add default via “$peer” table 2
ip rule add from “$address” table 2
fi

That was it! I lie. It would of been if not for me forgetting to modify the firewall rules. So technically that was it after 3mins of pondering about the ridiculously obvious.